+void wsj1::on_reply_(void *closure, struct afb_wsj1_msg *msg) {
+ std::function<void(const char*)> *onreply = reinterpret_cast<std::function<void(const char*)>*>(closure);
+ (*onreply)(afb_wsj1_msg_object_s(msg));
+ afb_wsj1_msg_unref(msg);
+ delete onreply;
+}
+
+sd_event *wsj1::eloop_() {
+ static sd_event *el = nullptr;
+ static std::mutex lock;
+ std::lock_guard<std::mutex> guard(lock);
+ if (!el) {
+ if (sd_event_new(&el) == 0) {
+ std::thread t(sd_event_loop, el);
+ t.detach();
+ }
+ }
+}
+
+
+