diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-07-01 18:07:12 +0200 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-07-03 21:22:39 +0200 |
commit | a33f575cda908c75ad18d56eff014f709186bde2 (patch) | |
tree | 084aa1c00c3fc4492090440ed23a27799106cc12 /src/include | |
parent | 7fcaf7d35dc94d3fe40faf59002131201ba24dc4 (diff) |
Switch back to recv/send instead of pub/sub for low-level API.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/deno.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/include/deno.h b/src/include/deno.h index 6246d1d23..e6516e427 100644 --- a/src/include/deno.h +++ b/src/include/deno.h @@ -17,15 +17,15 @@ typedef struct { struct deno_s; typedef struct deno_s Deno; -// A callback to receive a message from deno_pub javascript call. +// A callback to receive a message from deno.send javascript call. // buf is valid only for the lifetime of the call. -typedef void (*deno_sub_cb)(Deno* d, const char* channel, deno_buf buf); +typedef void (*deno_recv_cb)(Deno* d, const char* channel, deno_buf buf); void deno_init(); const char* deno_v8_version(); void deno_set_flags(int* argc, char** argv); -Deno* deno_new(void* data, deno_sub_cb cb); +Deno* deno_new(void* data, deno_recv_cb cb); void deno_delete(Deno* d); // Returns false on error. @@ -33,14 +33,14 @@ void deno_delete(Deno* d); // 0 = fail, 1 = success int deno_execute(Deno* d, const char* js_filename, const char* js_source); -// Routes message to the javascript callback set with deno_sub(). A false return -// value indicates error. Check deno_last_exception() for exception text. +// Routes message to the javascript callback set with deno.recv(). A false +// return value indicates error. Check deno_last_exception() for exception text. // 0 = fail, 1 = success -int deno_pub(Deno* d, const char* channel, deno_buf buf); +int deno_send(Deno* d, const char* channel, deno_buf buf); -// Call this inside a deno_sub_cb to respond synchronously to messages. -// If this is not called during the life time of a deno_sub_cb callback -// the denoPub() call in javascript will return null. +// Call this inside a deno_recv_cb to respond synchronously to messages. +// If this is not called during the life time of a deno_recv_cb callback +// the deno.send() call in javascript will return null. void deno_set_response(Deno* d, deno_buf buf); const char* deno_last_exception(Deno* d); |