mirror of
https://github.com/matrix-construct/construct
synced 2025-01-14 00:34:18 +01:00
modules: Update future object to support async contracts.
This commit is contained in:
parent
062e013617
commit
67af461540
2 changed files with 5 additions and 2 deletions
|
@ -38,6 +38,7 @@ conf_module_LTLIBRARIES = \
|
|||
|
||||
|
||||
moduledir=@moduledir@
|
||||
future_la_SOURCES = future.cc
|
||||
m_host_la_SOURCES = m_host.cc
|
||||
m_get_la_SOURCES = m_get.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
|
||||
|
||||
module_LTLIBRARIES = \
|
||||
future.la \
|
||||
m_host.la \
|
||||
m_get.la
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ future::future()
|
|||
}
|
||||
|
||||
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());
|
||||
|
||||
|
@ -54,7 +54,8 @@ future::on_new(object::handle, object &obj, const args &args)
|
|||
set(obj, "callback", args[0]);
|
||||
|
||||
const auto id(++id_ctr);
|
||||
task.pending_add(id);
|
||||
heap_object ho(obj);
|
||||
task.pending_add(id, ho);
|
||||
set(obj, "id", id);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue