* Set access/subscribe base URL with: CLICON_STREAM_URL_PREFIX (default https\

://localhost/streams).
    * Example: new stream "foo" will get access URL: https://localhost/streams/\
foo
  * Optional pub/sub support enabled by ./configure --enable-publish
    * Set publish URL base with: CLICON_STREAM_PUB_PREFIX (default http://local\
host/pub)
    * Example: new stream "foo" will get pub URL: https://localhost/pub/foo
This commit is contained in:
Olof Hagsand 2018-10-15 22:08:38 +02:00
parent dcec834455
commit d5f4969780
15 changed files with 438 additions and 58 deletions

View file

@ -39,8 +39,13 @@
/*
* Types
*/
/* subscription callback */
typedef int (*stream_fn_t)(clicon_handle h, void *event, void *arg);
/* Subscription callback
* @param[in] h Clicon handle
* @param[in] event Event as XML
* @param[in] arg Extra argument provided in stream_cb_add
* @see stream_cb_add
*/
typedef int (*stream_fn_t)(clicon_handle h, cxobj *event, void *arg);
struct stream_subscription{
struct stream_subscription *ss_next;
@ -76,6 +81,11 @@ int stream_notify(clicon_handle h, char *stream, const char *event, ...) __attr
int stream_notify(clicon_handle h, char *stream, const char *event, ...);
#endif
/* Experimental publish streams using SSE */
int stream_publish(clicon_handle h, char *stream);
int stream_publish_init();
int stream_publish_exit();
/* Backward compatible macro for <1.8 */
#define backend_notify_xml(h, stream, level, x) stream_notify_xml(h, stream, x)
#define backend_notify(h, stream, level, event) stream_notify(h, stream, event)