On Sun, 18 Aug 2013 15:40:14 GMT, Jack Applegame wrote:
How to send an Isolated object to other task?
This doesn't compile:class Test{} auto test = makeIsolated!Test; send(tid, test.move);
And this also doesn't compile:
receive ( (Isolated!Test){} );
Reason is disabled copying of IsolatedRef and it is impossible to store isolated objects in Variant:
Variant test = makeIsolated!Test; // Error: struct vibe.core.concurrency.IsolatedRef!(Test).IsolatedRef is not copyable because it is annotated with @disable
I've just committed a change set that works around the Variant
issue by using a temporary proxy struct
. Should work fine now (I just didn't directly send Isolated!T
values up to now and missed this error).