Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module is intended to provide a set of callbacks for various server events.
The set of callbacks provided fulfills the functionality require to be able to implement a local data-store reflecting server-sent data-update messages.
Web.DDP.Deadpan.Callbacks is used frequently in Web.DDP.Deadpan.
- pingCallback :: Callback
- clientDataSub :: Text -> Text -> Maybe [EJsonValue] -> DeadpanApp ()
- subscribe :: Text -> Text -> Maybe [EJsonValue] -> DeadpanApp ()
- clientDataUnsub :: Text -> DeadpanApp ()
- unsubscribe :: Text -> DeadpanApp ()
- clientRPCMethod :: Text -> Maybe [EJsonValue] -> Text -> Maybe Text -> DeadpanApp ()
- serverDataNosub :: Callback
- serverDataAdded :: Callback
- serverDataChanged :: Callback
- serverDataRemoved :: Callback
- serverDataReady :: Callback
- serverDataAddedBefore :: Callback
- serverDataMovedBefore :: Callback
- serverRPCResult :: Callback
- serverRPCUpdated :: Callback
- serverError :: Callback
Documentation
clientDataSub :: Text -> Text -> Maybe [EJsonValue] -> DeadpanApp () Source
Initiate a subscription to a named collection on the server.
Provide an id to refer to the subscription in future.
sub (client -> server): id: string (an arbitrary client-determined identifier for this subscription) name: string (the name of the subscription) params: optional array of EJSON items (parameters to the subscription)
subscribe :: Text -> Text -> Maybe [EJsonValue] -> DeadpanApp () Source
Synonym for clientDataSub
clientDataUnsub :: Text -> DeadpanApp () Source
Unsubscribe from an existing subscription indicated by its ID.
unsub (client -> server):
id: string (the id passed to sub
)
unsubscribe :: Text -> DeadpanApp () Source
Synonym for clientDataUnsub
clientRPCMethod :: Text -> Maybe [EJsonValue] -> Text -> Maybe Text -> DeadpanApp () Source
As explained in the Meteor DDP documentation:
method: string (method name) params: optional array of EJSON items (parameters to the method) id: string (an arbitrary client-determined identifier for this method call) randomSeed: optional JSON value (an arbitrary client-determined seed for pseudo-random generators)