0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-16 15:00:51 +01:00

modules: Update future object to support async contracts.

This commit is contained in:
Jason Volk 2016-11-13 16:39:26 -08:00
parent 062e013617
commit 67af461540
2 changed files with 5 additions and 2 deletions

View file

@ -38,6 +38,7 @@ conf_module_LTLIBRARIES = \
moduledir=@moduledir@ moduledir=@moduledir@
future_la_SOURCES = future.cc
m_host_la_SOURCES = m_host.cc m_host_la_SOURCES = m_host.cc
m_get_la_SOURCES = m_get.cc m_get_la_SOURCES = m_get.cc
#m_ban_la_SOURCES = m_ban.cc #m_ban_la_SOURCES = m_ban.cc
@ -125,6 +126,7 @@ m_get_la_SOURCES = m_get.cc
#sno_routing_la_SOURCES = sno_routing.cc #sno_routing_la_SOURCES = sno_routing.cc
module_LTLIBRARIES = \ module_LTLIBRARIES = \
future.la \
m_host.la \ m_host.la \
m_get.la m_get.la

View file

@ -46,7 +46,7 @@ future::future()
} }
void void
future::on_new(object::handle, object &obj, const args &args) future::on_new(object::handle callee, object &obj, const args &args)
{ {
auto &task(task::get()); auto &task(task::get());
@ -54,7 +54,8 @@ future::on_new(object::handle, object &obj, const args &args)
set(obj, "callback", args[0]); set(obj, "callback", args[0]);
const auto id(++id_ctr); const auto id(++id_ctr);
task.pending_add(id); heap_object ho(obj);
task.pending_add(id, ho);
set(obj, "id", id); set(obj, "id", id);
} }