On Sat, 06 Dec 2014 18:18:42 GMT, yawniek wrote:
=> how can i share a WorkerTask's id with tasks started from main (so those can message the worker)?
A worker task still has access to the global scope. You can set the Tid from the worker task in this gobal scope:
__gshared Tid g_worker;
__gshared TaskMutex g_mtx;
Any regular task can consult the global scope to figure out how to communicate with it. Use something like this:
synchronized(g_mtx)
g_worker.send( ... )
Is your leveldb wrapper doing blocking TCP or is it just an embedded connector? It seems odd having to put it in a foreign thread, but I've done this already for async files:
https://github.com/etcimon/libasync/blob/master/source/libasync/threads.d