Barrelfish
Functions
pubsub.h File Reference

Publish/Subscribe header file. More...

Functions

errval_t oct_subscribe (subscription_handler_fn, const void *, subscription_t *, const char *,...)
 Subscribe for a given type of message. More...
 
errval_t oct_unsubscribe (subscription_t)
 Unsubscribes a subscription. More...
 
errval_t oct_publish (const char *,...)
 Publishes a record. More...
 

Detailed Description

Publish/Subscribe header file.

Function Documentation

errval_t oct_publish ( const char *  record,
  ... 
)

Publishes a record.

Parameters
recordThe record to publish.
...Additional arguments to format the record using vsprintf.
Return values
SYS_ERR_OK
OCT_ERR_PARSER_FAIL
OCT_ERR_ENGINE_FAIL
errval_t oct_subscribe ( subscription_handler_fn  function,
const void *  state,
subscription_t *  id,
const char *  query,
  ... 
)

Subscribe for a given type of message.

Parameters
[in]functionHandler function in case a matching record is published.
[in]stateState passed on to handler function.
[out]idId of the subscription. In case of the value is undefined.
queryWhat type of records you want to subscribe.
...Additional arguments to format the record using vsprintf.
Return values
SYS_ERR_OK
OCT_ERR_MAX_SUBSCRIPTIONS
OCT_ERR_PARSER_FAIL
OCT_ERR_ENGINE_FAIL
errval_t oct_unsubscribe ( subscription_t  id)

Unsubscribes a subscription.

Parameters
idId of the subscription (as provided by oct_subscribe).
Return values
SYS_ERR_OK
OCT_ERR_PARSER_FAIL
OCT_ERR_ENGINE_FAIL