úÎOïB¦¢      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡None *+0;CN+ŠStores the functions that determine runtime behaviour in response to incoming messages and a policy for responding to unhandled messages.(functions that handle call/cast messages,functions that handle non call/cast messages"functions that handle exit signals a function that handles timeouts4a function that is run just before the process exits#how to deal with unhandled messagesVPolicy for handling unexpected messages, i.e., messages which are not sent using the ¢ or cast0 APIs, and which are not handled by any of the  handleInfo handlers. stop immediately, giving  ExitOther UnhandledInput as the reason *forward the message to the given recipient )log messages, then behave identically to Drop (dequeue and then drop/ignore the message A ProcessDefinition decorated with DispatchPriority for certain input domains.For a  +, this policy determines for how long the  receive looph should continue draining the process' mailbox before processing its received mail (in priority order).If a prioritised managed process+ is receiving a lot of messages (into its realÿ; mailbox), the server might never get around to actually processing its inputs. This (mandatory) policy provides a guarantee that eventually (i.e., after a specified number of received messages or time interval), the server will stop removing messages from its mailbox and process those it has already received.£0Provides dispatch for any exit signal - returns ¤ for unhandled exceptions)Provides dispatch for any input, returns ¤ for unhandled messages.AProvides dispatch from cast and call messages to a typed handler.The writable end of a .<Provides a means for servers to listen on a separate, typed control^ channel, thereby segregating the channel from their regular (and potentially busy) mailbox..An expression used to handle process timeouts.1An expression used to handle process termination.:An expression used to initialise a process with its state.¥An expression used to handle a channel message in a stateless process.¦An expression used to handle a channel message.§ An expression used to handle an info message. An expression used to handle a cast message.¨An expression used to handle a call message in a stateless process.©An expression used to handle a call. message where the reply is deferred via the ..!An expression used to handle a call message."»Wraps a predicate that is used to determine whether or not a handler is valid based on some combination of the current process state, the type and/or value of the input message or both.ª predicated on the process state and the message«$predicated on the process state only¬$predicated on the input message only#+Returned from handlers for the synchronous ¢( protocol, encapsulates the reply data andC the action to take after sending the reply. A handler can return NoReply! if they wish to ignore the call.$RThe action taken by a process after a handler has run and its updated state. See continue  timeoutAfter  hibernate stop stopWith%"continue with (possibly new) state&#timeout if no messages are received'hibernate for delay(stop the process, giving  ExitReason)stop the process with  ExitReason, with updated state*Return type for and  expression./Creates a new .05Obtain an opaque expression for communicating with a .k ­®¯°±²³´£µ¶·¸¹º»¼½¾¿ÀÁÂ¥¦§ ¨©!"ª«¬#ÃÄ$%&'()*+,-ÅÆÇÈÉÊ.ËÌÍÎ/0ÏÐÑÒÓÔÕÖרÙÚÛÜÝ_ ­®¯°±²³´£µ¶·¸¹º»¼½¾¿ÀÁÂ¥¦§ ¨©!"ª«¬#ÃÄ$%&'()*+,-ÅÆÇÈÉÊ.ËÌÍÎ/0ÏÐÑ1 ­¯°®®®±²³´£µ¶·¸¹»½ºº¼¾º¿ÀÁÂ¥¦§ ¨©!"ª«¬#ÃÄ$%&'()*+,-ÅÆÇÈÉÊ.ËÌÍÎ/0ÏÐÑÒÓÔÕÖרÙÚÛÜÝ(c) Tim Watson 2012 - 2013BSD3 (see the file LICENSE)%Tim Watson <watson.timothy@gmail.com> experimental#non-portable (requires concurrency)None;N 1Send a control message over a . This version of shutdown uses unsafe primitives.2ESend a signal instructing the process to terminate. This version of shutdown uses unsafe primitives.3Make a synchronous call - uses unsafe primitives.4Safe version of 3I that returns information about the error if the operation fails - uses unsafe primitives.5 Version of 4 that returns ¤ if the operation fails. Uses unsafe primitives.60Make a synchronous call, but timeout and return NothingH if a reply is not received within the specified time interval - uses unsafe primitives.8Invokes 3  out of band', and returns an "async handle." Uses unsafe primitives.9Sends a cast% message to the server identified by server - uses unsafe primitives.:Sends a channel% message to the server and returns a  ReceivePort - uses unsafe primitives. 123456789:;< 123456789:;< 123456789:;< 123456789:;<None;GN=>?@ABC=>?@ABC?>A@CB==>?@ABC(c) Tim Watson 2012 - 2013BSD3 (see the file LICENSE)%Tim Watson <watson.timothy@gmail.com> experimental#non-portable (requires concurrency)None;N+D Creates a ", from a function that takes a process state a and an input message b and returns a Þ7 indicating whether the associated handler should run.E Create a ", from a function that takes a process state a and returns a Þ6 indicating whether the associated handler should run.F Creates a "- from a function that takes an input message m and returns a Þ6 indicating whether the associated handler should run.G;Instructs the process to send a reply and continue running.H&Instructs the process to send a reply and evaluate the $.I.Instructs the process to skip sending a reply and evaluate a $J>Continue without giving a reply to the caller - equivalent to L*, but usable in a callback passed to the Y family of functions.KhHalt process execution during a call handler, without paying any attention to the expected return type.LAInstructs the process to continue running and receiving messages.M Version of L8 that can be used in handlers that ignore process state.N?Instructs the process loop to wait for incoming messages until ßB is exceeded. If no messages are handled during this period, the timeoute handler will be called. Note that this alters the process timeout permanently such that the given Delay" will remain in use until changed.O Version of N8 that can be used in handlers that ignore process state. <action (\(TimeoutPlease duration) -> timeoutAfter_ duration)PInstructs the process to  hibernate for the given à}. Note that no messages will be removed from the mailbox until after hibernation has ceased. This is equivalent to calling  threadDelay.Q Version of P8 that can be used in handlers that ignore process state. 5action (\(HibernatePlease delay) -> hibernate_ delay)RLInstructs the process to terminate, giving the supplied reason. If a valid * is installed, it will be called with the á8 returned from this call, along with the process state.SAs R9, but provides an updated state for the shutdown handler.T Version of R8 that can be used in handlers that ignore process state. )action (\ClientError -> stop_ ExitNormal)U%Sends a reply explicitly to a caller. replyTo = sendToVSends a reply to a â (for use in _ et al). replyChan = sendChanW Constructs a call handler from a function in the ãR monad. The handler expression returns the reply, and the action will be set to L. 0handleCall_ = handleCallIf_ $ input (const True)X Constructs a call* handler from an ordinary function in the ã< monad. This variant ignores the state argument present in Y and Zƒ and is therefore useful in a stateless server. Messges are only dispatched to the handler if the supplied condition evaluates to TrueSee YY Constructs a call handler from a function in the ã1 monad. > handleCall = handleCallIf (const True)Z Constructs a call* handler from an ordinary function in the ã monad. Given a function +f :: (s -> a -> Process (ProcessReply b s)), the expression  handleCall f will yield a  for inclusion in a  Behaviour specification for the  GenProcessV. Messages are only dispatched to the handler if the supplied condition evaluates to True.[ A variant of [! that ignores the state argument.\ A variant of ^! that ignores the state argument.]As Y but passes the .= to the handler function. This can be useful if you wish to  reply laterI to the caller by, e.g., spawning a process to do some work and have it replyTo caller response6 out of band. In this case the callback can pass the .5 to the worker (or stash it away itself) and return I.^As ]+ but only runs the handler if the supplied " evaluates to True._Creates a handler for a  typed channel- RPC style interaction. The handler takes a  SendPort b4 to reply to, the initial input and evaluates to a $D. It is the handler code's responsibility to send the reply to the SendPort.`As _C, but only evaluates the handler if the supplied condition is met.a A variant of _! that ignores the state argument.b A variant of `! that ignores the state argument.c Constructs a cast* handler from an ordinary function in the ã2 monad. > handleCast = handleCastIf (const True)d Constructs a cast* handler from an ordinary function in the ã monad. Given a function *f :: (s -> a -> Process (ProcessAction s)), the expression  handleCall f will yield a  for inclusion in a  Behaviour specification for the  GenProcess.e Constructs a control channel! handler from a function in the ã: monad. The handler expression returns no reply, and the control message% is treated in the same fashion as a cast. <handleControlChan = handleControlChanIf $ input (const True)f Version of e that ignores the server state.g Version of c that ignores the server state.h Version of d that ignores the server state.iConstructs an action handler. Like j this can handle both cast and callÿ4 messages, but you won't know which you're dealing with. This can be useful where certain inputs require a definite action, such as stopping the server, without concern for the state (e.g., when stopping we need only decide to stop, as the terminate handler can deal with state cleanup etc). For example: -action (MyCriticalSignal -> stop_ ExitNormal)jConstructs a handler for both call and cast messages. .handleDispatch = handleDispatchIf (const True)kConstructs a handler for both call and cast_ messages. Messages are only dispatched to the handler if the supplied condition evaluates to Truex. Handlers defined in this way have no access to the call context (if one exists) and cannot therefore reply to calls.lFCreates a generic input handler (i.e., for received messages that are not sent using the cast or call) APIs) from an ordinary function in the ã monad.mHandle completely raw input messages.n Creates an  exit handlere scoped to the execution of any and all the registered call, cast and info handlers for the process.2DEFGHIJKLMNOPQRSTUVWX7predicate that must be satisfied for the handler to run+a function from an input message to a replyYZ7predicate that must be satisfied for the handler to runBa reply yielding function over the process state and input message[\]^7predicate that must be satisfied for the handler to runJa reply yielding function over the process state, sender and input message_`abcd7predicate that must be satisfied for the handler to runDan action yielding function over the process state and input messagee(the receiving end of the control channelDan action yielding function over the process state and input messagefgh7predicate that must be satisfied for the handler to run'a function from the input message to a stateless action, cf Mi'a function from the input message to a stateless action, cf Mjklmnoäåæçèé,DEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmno,DEFGHILNPRSUVJKMOQTYZ]^_`cdlmjknoiWX[\abghef2DEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnoäåæçèéNone ;GNêëìíîïðñòóôõö÷øùúïóêëìíîïðñòóôõö÷øùú(c) Tim Watson 2012 - 2013BSD3 (see the file LICENSE)%Tim Watson <watson.timothy@gmail.com> experimental#non-portable (requires concurrency)None+;CNpThe result of a safe û handler's execution.qcontinue executingr#timeout if no messages are receivedshibernate (i.e., sleep)t!stop/terminate the server processuThe result of a call handler's execution.vreply with the given termw+reply with the given term and enter timeoutx'reply with the given term and hibernatey&stop the process with the given reasonzORestricted (i.e., pure, free from side effects) execution environment for callcastinfo handlers to execute in.{3Log a trace message using the underlying Process's say|Get the current process state}Put a new process state state~7Apply the given expression to the current process state;Instructs the process to send a reply and continue running.€>Continue without giving a reply to the caller - equivalent to ‚*, but usable in a callback passed to the † family of functions.hHalt process execution during a call handler, without paying any attention to the expected return type.‚AInstructs the process to continue running and receiving messages.ƒ?Instructs the process loop to wait for incoming messages until ßB is exceeded. If no messages are handled during this period, the timeoute handler will be called. Note that this alters the process timeout permanently such that the given Delay" will remain in use until changed.„Instructs the process to  hibernate for the given à€. Note that no messages will be removed from the mailbox until after hibernation has ceased. This is equivalent to evaluating liftIO . threadDelay.…LInstructs the process to terminate, giving the supplied reason. If a valid * is installed, it will be called with the á8 returned from this call, along with the process state.†tA version of "Control.Distributed.Process.ManagedProcess.Server.handleCall" that takes a handler which executes in z.‡vA version of "Control.Distributed.Process.ManagedProcess.Server.handleCallIf" that takes a handler which executes in z.ˆtA version of "Control.Distributed.Process.ManagedProcess.Server.handleCast" that takes a handler which executes in z.‰vA version of "Control.Distributed.Process.ManagedProcess.Server.handleCastIf" that takes a handler which executes in z.ŠtA version of "Control.Distributed.Process.ManagedProcess.Server.handleInfo" that takes a handler which executes in z.ü;TODO MonadTrans instance? lift :: (Monad m) => m a -> t m a#pqrstuvwxyzýþ{|}~€‚ƒ„…†‡ˆ‰7predicate that must be satisfied for the handler to runDan action yielding function over the process state and input messageŠ‹Œÿüpqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹Œzuvwxypqrst†‡ˆ‰Š‹Œ}|~€‚ƒ„…{pqrstuvwxyzýþ{|}~€‚ƒ„…†‡ˆ‰Š‹Œÿü(c) Tim Watson 2012 - 2013BSD3 (see the file LICENSE)%Tim Watson <watson.timothy@gmail.com> experimental#non-portable (requires concurrency)None;N Send a control message over a .Ž8Send a signal instructing the process to terminate. The  receive loop4 which manages the process mailbox will prioritise Shutdownÿ` signals higher than any other incoming messages, but the server might be busy (i.e., still in the process of excuting a handler) at the time of sending however, so the caller should not make any assumptions about the timeliness with which the shutdown signal will be handled. If responsiveness is important, a better approach might be to send an  exit signal with ‰ as the reason. An exit signal will interrupt any operation currently underway and force the running process to clean up and terminate.dMake a synchronous call - will block until a reply is received. The calling process will exit with á if the calls fails.Safe version of Œ that returns information about the error if the operation fails. If an error occurs then the explanation will be will be stashed away as (ExitOther String).‘ Version of  that returns ¤e if the operation fails. If you need information about *why* a call has failed then you should use  or combine  catchExit and call instead.’0Make a synchronous call, but timeout and return Nothing@ if a reply is not received within the specified time interval.qIf the result of the call is a failure (or the call was cancelled) then the calling process will exit, with the áÿa given as the reason. If the call times out however, the semantics on the server side are undefined, i.e., the server may or may not successfully process the request and may (or may not) send a response at a later time. From the callers perspective, this is somewhat troublesome, since the call result cannot be decoded directly. In this case, the “ API mayJ be used to attempt to receive the message later on, however this makes no attempt whatsoever to guarantee which‚ call response will in fact be returned to the caller. In those semantics are unsuited to your application, you might choose to exit or die2 in case of a timeout, or alternatively, use the ” API and associated  waitTimeout function (in the  Async APIS), which takes a re-usable handle on which to wait (with timeouts) multiple times.”Invokes   out of band, and returns an  async handle.•Sends a cast% message to the server identified by server=. The server will not send a response. Like Cloud Haskell's , primitive, cast is fully asynchronous and  never fails - therefore •Ning to a non-existent (e.g., dead) server process will not generate an error.–Sends a channel% message to the server and returns a  ReceivePortq on which the reponse can be delivered, if the server so chooses (i.e., the might ignore the request or crash).—A synchronous version of –.˜A safe version of —, which returns Left ExitReason if the call fails. Ž‘’“”•–—˜ Ž‘’“”•–—˜ Ž‘’“”•–—˜ Ž‘’“”•–—˜(c) Tim Watson 2012BSD3 (see the file LICENSE)%Tim Watson <watson.timothy@gmail.com> experimental#non-portable (requires concurrency)None+;N ™ Starts the message handling loopÅ for a managed process configured with the supplied process definition, after calling the init handler with its initial arguments. Note that this function does not return until the server exits.š Starts the message handling loopÒ for a prioritised managed process, configured with the supplied process definition, after calling the init handler with its initial arguments. Note that this function does not return until the server exits.› Starts the message handling loop1 for a managed process, configured with a typed control channel{. The caller supplied expression is evaluated with an opaque reference to the channel, which must be passed when calling handleControlChanf. The meaning and behaviour of the init handler and initial arguments are the same as those given to ™B. Note that this function does not return until the server exits.œ Wraps any  process loopa and ensures that it adheres to the managed process start/stop semantics, i.e., evaluating the  InitHandler. with an initial state and delay will either die due to InitStop, exit silently (due to  InitIgnore) or evaluate the process' loop. The supplied loop must evaluate to  ExitNormal(, otherwise the calling processing will die with whatever  ExitReason is given. A default 2, with no api, info or exit handler. The default  simply continues, the  is a no-op and the  is  Terminate.žTurns a standard  into a  %, by virtue of the supplied list of  expressions.Sets the default recvTimeoutPolicy!, which gives up after 10k reads.ŸCreates a default   from a list of . See  for the underlying definition. A basic, stateless . See  for the default field values.¡A default, state unaware  that can be used with  . This simply returns InitOk2 with the empty state (i.e., unit) and the given ß. ™š›œžŸ ¡w  !"#$%&'()*+,-./0=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijlmnŽ‘’“”•–—˜™š›œžŸ ¡d*+,-™š›œž $%&'()#"!  .Ÿ ¡YZ]^cdlm_`ijnW[X\ghab/0efDEFGHIJKLMNOPQRSTUV ™š›œžŸ ¡       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„MO…RTVX_`ijrt†789:;<=>?@AB‡ˆ‰Š‹ŒŽ‘9’“”•–—˜™š(›œžŸ ¡¢£¤’¥¦§¨©ª«¬!­"®)¯°°±²³´4µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÊËÍÊÎÏÐÑÐÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçè“é?ê€ëìíîÊÎïÊðñòódistr_Iorfoq9MgiA7RqLAUJsWQU*Control.Distributed.Process.ManagedProcess7Control.Distributed.Process.ManagedProcess.UnsafeClient:Control.Distributed.Process.ManagedProcess.Server.Priority1Control.Distributed.Process.ManagedProcess.ServerControl.Distributed.Process.ManagedProcess.Internal.GenProcessProcessDefinition apiHandlers infoHandlers exitHandlerstimeoutHandlershutdownHandlerunhandledMessagePolicyUnhandledMessagePolicy Terminate DeadLetterLogDropPrioritisedProcessDefinition processDef priorities recvTimeoutRecvTimeoutPolicy RecvCounter RecvTimerDispatchPriorityPrioritygetPrioDeferredDispatcher Dispatcher ControlPortControlChannelTimeoutHandlerShutdownHandler InitHandler CastHandler CallHandler Condition ProcessReply ProcessActionProcessContinueProcessTimeoutProcessHibernate ProcessStopProcessStopping InitResultInitOkInitStop InitIgnoreCallRefnewControlChanchannelControlPortsendControlMessageshutdowncallsafeCalltryCall callTimeoutflushPendingCalls callAsynccastcallChan syncCallChansyncSafeCallChan setPriorityprioritiseCall_prioritiseCallprioritiseCast_prioritiseCastprioritiseInfo_prioritiseInfo conditionstateinputreply replyWithnoReplynoReply_ haltNoReply_continue continue_ timeoutAfter timeoutAfter_ hibernate hibernate_stopstopWithstop_replyTo replyChan handleCall_ handleCallIf_ handleCall handleCallIfhandleCallFrom_handleCallFromIf_handleCallFromhandleCallFromIf handleRpcChanhandleRpcChanIfhandleRpcChan_handleRpcChanIf_ handleCast handleCastIfhandleControlChanhandleControlChan_ handleCast_ handleCastIf_actionhandleDispatchhandleDispatchIf handleInfo handleRaw handleExit handleExitIfRestrictedActionRestrictedContinueRestrictedTimeoutRestrictedHibernateRestrictedStopResultReplyTimeout HibernateStopRestrictedProcesssaygetStateputState modifyState haltNoReply handleTimeoutservepserve chanServe runProcessdefaultProcess prioritiseddefaultProcessWithPrioritiesstatelessProcess statelessInitdistr_KAnEvuZEhZc0y1Ml6i83So*Control.Distributed.Process.Internal.SpawnExitSignalDispatcherbaseGHC.BaseNothingStatelessChannelHandlerChannelHandler InfoHandlerStatelessCallHandlerDeferredCallHandlerStateInputPrioritiseCall prioritisePrioritiseCastPrioritiseInfoDynMessageHandlerdynHandleMessageMessageMatcher matchDispatch dispatchExit dispatchInfoDispatchdispatch DispatchIf dispatchIf DispatchCCchannelunPort unControlNoReply CallResponseMessage CastMessage CallMessage ChanMessageunCallerCallIdmakeRefinitCallunsafeInitCall waitResponse%$fDynMessageHandlerDeferredDispatcher$fDynMessageHandlerDispatcher$fMessageMatcherDispatcher$fEqControlPort$fNFDataCallResponse$fBinaryCallResponse$fNFDataMessage$fBinaryMessage$fRoutableCallRef$fResolvableCallRef$fNFDataCallRef$fBinaryCallRefghc-prim GHC.TypesBooldistr_HYg6UQutl3vFpMhwtLKTXw'Control.Distributed.Process.Extras.TimeDelay TimeInterval1Control.Distributed.Process.Extras.Internal.Types ExitReason*Control.Distributed.Process.Internal.TypesSendPortProcessmkReplycheckcheckRpc checkCall checkCastdecode TimeoutActionGo TimeoutSpecQueue precvLoop recvQueuedrainMessageQueueenqueueMessagerecvLoop startTimer checkTimer pollTimershutdownHandler'trapExitblock applyPolicy Data.Typeablelift unRestricted wrapHandlerwrapCall runRestrictedShutdown3Control.Distributed.Process.Extras.UnsafePrimitivessenddefaultRecvTimeoutPolicy