+static struct job_string *make_job_string(const char *event, struct json_object *object)
+{
+ size_t sz = 1 + strlen(event);
+ struct job_string *js = malloc(sz + sizeof *js);
+ if (js) {
+ js->object = object;
+ memcpy(js->event, event, sz);
+ }
+ return js;
+}
+
+/*
+ * Destroy structure 'js' for job of broadcasting string events
+ */
+static void destroy_job_string(struct job_string *js)
+{
+ json_object_put(js->object);
+ free(js);
+}
+
+/*
+ * Create structure for job of broadcasting or pushing 'evtid' with 'object'
+ * Returns the created structure or NULL if out of memory
+ */
+static struct job_evtid *make_job_evtid(struct afb_evtid *evtid, struct json_object *object)
+{
+ struct job_evtid *je = malloc(sizeof *je);
+ if (je) {
+ je->evtid = afb_evt_evtid_addref(evtid);
+ je->object = object;
+ }
+ return je;
+}
+
+/*
+ * Destroy structure for job of broadcasting or pushing evtid
+ */
+static void destroy_job_evtid(struct job_evtid *je)
+{
+ afb_evt_evtid_unref(je->evtid);
+ json_object_put(je->object);
+ free(je);
+}
+
+/*
+ * Broadcasts the 'event' of 'id' with its 'object'
+ */
+static void broadcast(const char *event, struct json_object *object, int id)