On Tuesday, 15 August 2017 at 21:27:49 UTC, Arek wrote:
Yes, but this doesn't compile:import std.stdio; import std.concurrency; struct A { int t; int r; int method() shared { return 0; } } void consumer() { shared a = receiveOnly!(shared A)(); } void main() { auto cons = spawn(&consumer); send(cons, shared A()); }
AIU you use struct as a Unique-like wrapper for shared class object. Extract the object and send it, then wrap again on arrival.