Safe Haskell | None |
---|---|
Language | Haskell2010 |
Support for invoking MethodHandler
s
Synopsis
- invokePurePromise :: InvokePureCtx m p r => MethodHandler m p r -> p -> m (Promise r)
- (?) :: InvokePureCtx m p r => MethodHandler m p r -> p -> m (Promise r)
- invokePure :: InvokePureCtx m p r => MethodHandler m p r -> p -> Fulfiller r -> m ()
- type InvokePureCtx m p r = (MonadThrow m, MonadSTM m, PrimMonad m, Decerialize r, ToStruct ConstMsg (Cerial ConstMsg p), ToStruct (MutMsg (PrimState m)) (Cerial (MutMsg (PrimState m)) p), Cerialize p, FromPtr ConstMsg (Cerial ConstMsg r))
- invokeRaw :: (MonadThrow m, MonadSTM m, PrimMonad m, Decerialize r, Decerialize p, ToStruct ConstMsg (Cerial ConstMsg p), FromPtr ConstMsg (Cerial ConstMsg r)) => MethodHandler m p r -> Cerial ConstMsg p -> Fulfiller (Cerial ConstMsg r) -> m ()
Using high-level representations
invokePurePromise :: InvokePureCtx m p r => MethodHandler m p r -> p -> m (Promise r) Source #
Like invokePure
, but returns a promise instead of accepting a fulfiller.
(?) :: InvokePureCtx m p r => MethodHandler m p r -> p -> m (Promise r) Source #
Alias for invokePurePromise
invokePure :: InvokePureCtx m p r => MethodHandler m p r -> p -> Fulfiller r -> m () Source #
Like invokeRaw
, but uses the high-level representations of the data
types.
type InvokePureCtx m p r = (MonadThrow m, MonadSTM m, PrimMonad m, Decerialize r, ToStruct ConstMsg (Cerial ConstMsg p), ToStruct (MutMsg (PrimState m)) (Cerial (MutMsg (PrimState m)) p), Cerialize p, FromPtr ConstMsg (Cerial ConstMsg r)) Source #
Shorthand for class contstraints needed to invoke a method using the high-level API.
Using low level representations
invokeRaw :: (MonadThrow m, MonadSTM m, PrimMonad m, Decerialize r, Decerialize p, ToStruct ConstMsg (Cerial ConstMsg p), FromPtr ConstMsg (Cerial ConstMsg r)) => MethodHandler m p r -> Cerial ConstMsg p -> Fulfiller (Cerial ConstMsg r) -> m () Source #
Invoke a method by passing it the low-level representation of its parameter,
and a Fulfiller
that can be used to supply (the low-level representation of)
its return value.