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
73
Issues
73
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
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
00928dc2
Commit
00928dc2
authored
Feb 12, 2019
by
Mart Lubbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove updateClock backgroundtask
parent
946848f4
Pipeline
#18768
passed with stage
in 6 minutes and 20 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
22 deletions
+22
-22
Libraries/iTasks/Engine.icl
Libraries/iTasks/Engine.icl
+11
-12
Libraries/iTasks/Internal/EngineTasks.icl
Libraries/iTasks/Internal/EngineTasks.icl
+6
-8
Libraries/iTasks/Internal/TaskServer.icl
Libraries/iTasks/Internal/TaskServer.icl
+5
-2
No files found.
Libraries/iTasks/Engine.icl
View file @
00928dc2
...
...
@@ -79,8 +79,7 @@ where
=
[(
serverPort
,
httpServer
serverPort
keepaliveTime
(
engineWebService
webTasks
)
taskOutput
)]
engineTasks
=
[
BackgroundTask
updateClock
,
BackgroundTask
(
processEvents
MAX_EVENTS
)
[
BackgroundTask
(
processEvents
MAX_EVENTS
)
:
if
(
webTasks
=:
[])
[
BackgroundTask
stopOnStable
]
[
BackgroundTask
removeOutdatedSessions
...
...
Libraries/iTasks/Internal/EngineTasks.icl
View file @
00928dc2
...
...
@@ -54,12 +54,10 @@ updateClock :: !*IWorld -> *(!MaybeError TaskException (), !*IWorld)
updateClock
iworld
=:{
IWorld
|
clock
,
world
}
//Determine current date and time
#
(
timespec
,
world
)
=
nsTime
world
#
iworld
=
{
iworld
&
world
=
world
}
#
iworld
&
world
=
world
//Write SDS if necessary
#
(
mbe
,
iworld
)
=
write
timespec
(
sdsFocus
{
start
=
zero
,
interval
=
zero
}
iworldTimespec
)
EmptyContext
iworld
=
case
mbe
of
(
Error
e
)
->
(
Error
e
,
iworld
)
(_)
->
(
Ok
(),
iworld
)
=
(()
<$
mbe
,
iworld
)
//When we run the built-in HTTP server we need to do active garbage collection of instances that were created for sessions
removeOutdatedSessions
::
!*
IWorld
->
*(!
MaybeError
TaskException
(),
!*
IWorld
)
...
...
Libraries/iTasks/Internal/TaskServer.icl
View file @
00928dc2
...
...
@@ -10,6 +10,7 @@ import qualified Data.Map as DM
import
qualified
iTasks
.
Internal
.
SDS
as
SDS
import
TCPChannelClass
,
TCPChannels
,
TCPEvent
,
TCPStringChannels
,
TCPDef
,
tcp
import
iTasks
.
Internal
.
EngineTasks
import
iTasks
.
Engine
,
iTasks
.
Internal
.
IWorld
,
iTasks
.
Internal
.
TaskEval
,
iTasks
.
Internal
.
TaskStore
import
iTasks
.
Internal
.
IWorld
import
iTasks
.
Internal
.
Task
...
...
@@ -78,8 +79,10 @@ loop determineTimeout iworld=:{ioTasks,sdsNotifyRequests}
#
(
mbTimeout
,
iworld
=:{
IWorld
|
ioTasks
={
todo
},
world
})
=
determineTimeout
{
iworld
&
ioTasks
=
{
done
=[],
todo
=
ioTasks
.
todo
++
(
reverse
ioTasks
.
done
)}}
//Check which mainloop tasks have data available
#
(
todo
,
chList
,
world
)
=
select
mbTimeout
todo
world
#
(
merr
,
iworld
)
=
updateClock
{
iworld
&
ioTasks
=
{
done
=[],
todo
=
todo
},
world
=
world
}
|
merr
=:(
Error
_)
=
abort
"Error updating clock"
//Process the select result
#
iworld
=:{
shutdown
,
ioTasks
={
done
}}
=
process
0
chList
{
iworld
&
ioTasks
=
{
done
=[],
todo
=
todo
},
world
=
world
}
#
iworld
=:{
shutdown
,
ioTasks
={
done
}}
=
process
0
chList
iworld
//Move everything from the done list back to the todo list
#
iworld
=
{
iworld
&
ioTasks
={
todo
=
reverse
done
,
done
=[]}}
//Everything needs to be re-evaluated
...
...
@@ -153,7 +156,7 @@ where
=
(
n
+
1
,[
x
:
xs
])
//TODO: Use share notification to trigger task re-evaluation based on io events
process
::
!
Int
[(!
Int
,!
SelectResult
)]
!*
IWorld
->
!
*
IWorld
process
::
!
Int
[(!
Int
,!
SelectResult
)]
!*
IWorld
->
*
IWorld
process
i
chList
iworld
=:{
ioTasks
={
done
,
todo
=[]}}
=
iworld
process
i
chList
iworld
=:{
ioTasks
={
done
,
todo
=[
ListenerInstance
lopts
listener
:
todo
]},
ioStates
,
world
}
#
taskId
=:(
TaskId
instanceNo
_)
=
lopts
.
ListenerInstanceOpts
.
taskId
...
...
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