rpc between Tasks of vibe.d

crimaniak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Oct 28 21:16:49 PDT 2016


Hi All!

I will try to illustrate by code what exactly I have in mind:

// we have not shared class/struct with some interface.
class FooController
{
...
     int foo1(int a, string b);
     string foo2(Struct1 c);
...
}

// now we want to make a running task with an instance inside

auto controllerTask = runTask((){

   auto controller = new FooController();
   ReceiveCalls!FooController(controller);

});


// and call it from other tasks, like this

int result1 = Call!FooController(controllerTask).foo1(123, "abc");
string result2 = 
Call!FooController(controllerTask).foo2(Struct1(...));


Is there any interface generator for this? Or what can you 
suggest?

Thanks!



More information about the Digitalmars-d-learn mailing list