Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iTasks-SDK
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
82
Issues
82
List
Boards
Labels
Service Desk
Milestones
Merge Requests
10
Merge Requests
10
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
iTasks-SDK
Commits
b55efdae
Commit
b55efdae
authored
Sep 10, 2019
by
Mart Lubbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
detect overlapping endpoints and show the web instructions only once
parent
64c119c5
Pipeline
#29330
passed with stage
in 4 minutes and 34 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
Libraries/iTasks/Engine.icl
Libraries/iTasks/Engine.icl
+14
-11
No files found.
Libraries/iTasks/Engine.icl
View file @
b55efdae
...
...
@@ -2,6 +2,7 @@ implementation module iTasks.Engine
import
Data
.
Func
import
Data
.
Functor
import
Data
.
List
import
Data
.
Queue
import
Internet
.
HTTP
import
StdEnv
...
...
@@ -53,16 +54,24 @@ doTasksWithOptions initFun startable world
#
(
Right
iworld
)
=
mbIWorld
#
(
symbolsResult
,
iworld
)
=
initSymbolsShare
options
.
distributed
options
.
appName
iworld
|
symbolsResult
=:
(
Error
_)
=
show
[
"Error reading symbols while required: "
+++
fromError
symbolsResult
]
(
setReturnCode
1
(
destroyIWorld
iworld
))
#
iworld
=
if
(
hasDup
requestPaths
)
(
iShow
[
"Duplicate path in the web tasks: "
,
join
", "
[
"'"
+++
p
+++
"'"
\\
p
<-
requestPaths
]]
iworld
)
iworld
#
iworld
=
serve
(
startupTasks
options
)
(
tcpTasks
options
.
serverPort
options
.
keepaliveTime
)
(
timeout
options
.
timeout
)
iworld
=
destroyIWorld
iworld
where
requestPaths
=
[
path
\\{
path
}<-
webTasks
]
webTasks
=
[
t
\\
WebTask
t
<-
toStartable
startable
]
startupTasks
{
distributed
,
sdsPort
}
=
if
(
webTasks
=:
[])
//if there are no webtasks: stop when stable
[
systemTask
(
startTask
stopOnStable
)]
//if there are: show instructions andcleanup old sessions
[
startTask
viewWebServerInstructions
,
systemTask
(
startTask
removeOutdatedSessions
)]
//If distributed, start sds service task
=
(
if
distributed
[
systemTask
(
startTask
(
sdsServiceTask
sdsPort
))]
[])
++
(
if
distributed
[
systemTask
(
startTask
(
sdsServiceTask
sdsPort
))]
[])
++
[
systemTask
(
startTask
flushWritesWhenIdle
)
//If there no webtasks, stop when stable, otherwise cleanup old sessions
,
systemTask
(
startTask
if
(
webTasks
=:
[])
stopOnStable
removeOutdatedSessions
)
//Start all startup tasks
:[
t
\\
StartupTask
t
<-
toStartable
startable
]]
...
...
@@ -161,17 +170,11 @@ where
instance
Startable
(
Task
a
)
|
iTask
a
//Default as web task
where
toStartable
task
=
[
onStartup
viewWebServerInstructions
,
onRequest
"/"
task
]
toStartable
task
=
[
onRequest
"/"
task
]
instance
Startable
(
HTTPRequest
->
Task
a
)
|
iTask
a
//As web task
where
toStartable
task
=
[
onStartup
viewWebServerInstructions
,
onRequestFromRequest
"/"
task
]
toStartable
task
=
[
onRequestFromRequest
"/"
task
]
instance
Startable
StartableTask
where
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment