diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-06-11 21:57:25 +0200 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-06-11 21:57:25 +0200 |
commit | 7242f2b5a5118ee5b5cd2295761a703b54cee771 (patch) | |
tree | 5d7b787b28cdff2c0057d7903efeca7aaeba143c /deno2/include/deno.h | |
parent | 997b300745b343feab58e715aa225396f9b896c8 (diff) |
Add channel to pub/sub
Diffstat (limited to 'deno2/include/deno.h')
-rw-r--r-- | deno2/include/deno.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/deno2/include/deno.h b/deno2/include/deno.h index 4678a94af..63f26ba8c 100644 --- a/deno2/include/deno.h +++ b/deno2/include/deno.h @@ -18,7 +18,7 @@ struct deno_s; typedef struct deno_s Deno; // The callback from V8 when data is sent. -typedef deno_buf (*deno_sub_cb)(Deno* d, deno_buf buf); +typedef deno_buf (*deno_sub_cb)(Deno* d, const char* channel, deno_buf buf); void deno_init(); const char* deno_v8_version(); @@ -31,9 +31,9 @@ Deno* deno_new(void* data, deno_sub_cb cb); // Get error text with deno_last_exception(). bool deno_execute(Deno* d, const char* js_filename, const char* js_source); -// Returns false on error. -// Get error text with deno_last_exception(). -bool deno_pub(Deno* d, deno_buf buf); +// Routes message to the javascript callback set with deno_sub(). A false return +// value indicates error. Check deno_last_exception() for exception text. +bool deno_pub(Deno* d, const char* channel, deno_buf buf); const char* deno_last_exception(Deno* d); |