Process Module

Recipe

  • message
message CleanUpDb
  • publishable
publishable message CleanUpDb
  • timer
publishable message CleanUpDb
timer EveryNight(CleanUpDb) in Asia/Calcutta {
        at 00:05
}
  • durable
message Print(mode:Int)
durable processor EventTracer {
        accept message-ref Print
}
  • processor
processor Background { //custom/singleton {
        subscribe message-ref CleanUpDb
}
  • role-ref
role-ref DownloadTaskSupervisor, Downloader("DD")
  • reactor
reactor[ValeyStream] ValeyStream {
group Flow(
                FlowCreated,
                FlowStallSet)
}
  • flow
flow SMFX  {
        document(howMany:Int?,value:Int?)

        task S {
                realizer manual(SomeRole) distribution(user)
        }
        task M {
                input(howMany!)
            realizer mi Ms
        }

        subtask Ms {
             input(i:Int)
                 output(o:Int)
                 realizer manual(SomeRole) distribution(user)
        }
        task FT {
                output(value)
                realizer flow S1
        }
        task XT {
                input(howMany!)
                output(value)
                realizer mi XTs
        }

        subtask XTs {
                input(value:Int)
                output(value:Int)
                realizer flow S1
        }
        net {
                init-document(howMany!,value)
                START out(S)
                connector C1 in(S) out(M)
                connector C2 in(M) out(FT)
                connector C3 in(FT) out(XT)
                END in(XT)

                }


        net Parallel {
                init-document(howMany!,value)
                START out (S, M)
                connector C1 in(S, M) out(FT)
                connector C2 in(FT) out(XT)
                END in(XT)
        }
        net AllParallel {
                init-document(howMany!,value)
                START out (S, M,FT,XT)
                END in(S,M,FT,XT)
        }

        net SelectOne {
                init-document(howMany!,value)
                START out(S)
                connector C1 in(S) out select {
                        case doub => `howMany.get==2`  => M
                        case half => `howMany.get==1` => FT
                        case default => XT
                }
                END in any(M,FT,XT)
        }


        net SelectTwo {
                init-document(howMany!,value)
                START out(S)
                connector C1 in(S) out select {
                        case doub => `howMany.get==2`  => M,FT
                        case half => `howMany.get==1` => FT
                        case default => XT
                }
                END in any(M,FT,XT)
        }
}
  • task-processor
task-processor SomeTaskPro {
        accept task-ref Skip.someTask //This task must be a worker task
}

Recipes