Commit 5d1d99c7 authored by Bas Lijnse's avatar Bas Lijnse

Added better cleanup after exceptions to parallel combinator

parent 733f007a
......@@ -77,6 +77,7 @@ taskInstanceShares :: RWShared InstanceNo (Map TaskId DeferredJSON) (Map Ta
localShare :: RWShared TaskId a a | iTask a
//Core parallel task list state structure
taskInstanceParallelTaskLists :: RWShared InstanceNo (Map TaskId [ParallelTaskState]) (Map TaskId [ParallelTaskState])
taskInstanceParallelTaskList :: RWShared (TaskId,TaskListFilter) [ParallelTaskState] [ParallelTaskState]
//Private interface used during evaluation of parallel combinator
......
......@@ -426,8 +426,11 @@ taskInstanceEmbeddedTask :: RWShared TaskId (Task a) (Task a) | iTask a
taskInstanceEmbeddedTask = sdsLens "taskInstanceEmbeddedTask" param (SDSRead read) (SDSWrite write) (SDSNotifyConst notify) taskInstanceReduct
where
param (TaskId instanceNo _) = instanceNo
read taskId {TIReduct|tasks} = case fmap unwrapTask ('DM'.get taskId tasks) of
Just task = Ok task
//TODO: Investigate why unwrapTask (from clientoverride) no longer works here
read taskId {TIReduct|tasks} = case ('DM'.get taskId tasks) of
(Just dyn) = case dyn of
(task :: Task a^) = Ok task
_ = Error (exception ("Could not unwrap embedded task " <+++ taskId))
_ = Error (exception ("Could not find embedded task " <+++ taskId))
write taskId r=:{TIReduct|tasks} w = Ok (Just {TIReduct|r & tasks = 'DM'.put taskId (dynamic w :: Task a^) tasks})
notify taskId _ = const ((==) taskId)
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment