Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- cast :: forall r q o. (HasCallStack, SetMember Process (Process q) r, Member Interrupts r, Typeable o, Typeable (Api o Asynchronous)) => SchedulerProxy q -> Server o -> Api o Asynchronous -> Eff r ()
- call :: forall result api r q. (SetMember Process (Process q) r, Member Interrupts r, Typeable api, Typeable (Api api (Synchronous result)), Typeable result, HasCallStack, NFData result, Show result) => SchedulerProxy q -> Server api -> Api api (Synchronous result) -> Eff r result
- castRegistered :: (Typeable o, ServesApi o r q, HasCallStack, Member Interrupts r) => SchedulerProxy q -> Api o Asynchronous -> Eff r ()
- callRegistered :: (Typeable reply, ServesApi o r q, HasCallStack, NFData reply, Show reply, Member Interrupts r) => SchedulerProxy q -> Api o (Synchronous reply) -> Eff r reply
- type ServesApi o r q = (Typeable o, SetMember Process (Process q) r, Member (ServerReader o) r)
- type ServerReader o = Reader (Server o)
- whereIsServer :: Member (ServerReader o) e => Eff e (Server o)
- registerServer :: HasCallStack => Server o -> Eff (ServerReader o ': r) a -> Eff r a
Calling APIs directly
cast :: forall r q o. (HasCallStack, SetMember Process (Process q) r, Member Interrupts r, Typeable o, Typeable (Api o Asynchronous)) => SchedulerProxy q -> Server o -> Api o Asynchronous -> Eff r () Source #
Send an Api
request that has no return value and return as fast as
possible. The type signature enforces that the corresponding Api
clause is
Asynchronous
. The operation never fails, if it is important to know if the
message was delivered, use call
instead.
call :: forall result api r q. (SetMember Process (Process q) r, Member Interrupts r, Typeable api, Typeable (Api api (Synchronous result)), Typeable result, HasCallStack, NFData result, Show result) => SchedulerProxy q -> Server api -> Api api (Synchronous result) -> Eff r result Source #
Send an Api
request and wait for the server to return a result value.
The type signature enforces that the corresponding Api
clause is
Synchronous
.
Server Process Registration
castRegistered :: (Typeable o, ServesApi o r q, HasCallStack, Member Interrupts r) => SchedulerProxy q -> Api o Asynchronous -> Eff r () Source #
Like cast
but take the Server
from the reader provided by
registerServer
.
callRegistered :: (Typeable reply, ServesApi o r q, HasCallStack, NFData reply, Show reply, Member Interrupts r) => SchedulerProxy q -> Api o (Synchronous reply) -> Eff r reply Source #
Like call
but take the Server
from the reader provided by
registerServer
.
type ServesApi o r q = (Typeable o, SetMember Process (Process q) r, Member (ServerReader o) r) Source #
type ServerReader o = Reader (Server o) Source #
The reader effect for ProcessId
s for Api
s, see registerServer
whereIsServer :: Member (ServerReader o) e => Eff e (Server o) Source #
Get the Server
registered with registerServer
.
registerServer :: HasCallStack => Server o -> Eff (ServerReader o ': r) a -> Eff r a Source #
Run a reader effect that contains the one server handling a specific
Api
instance.