On 2013-11-03 13:05:16 +0000, Sönke Ludwig said:

On Sat, 2 Nov 2013 18:07:40 -0400, Shammah Chancellor wrote:

What is going on here?

Code:

class Message

{

...

}

task.send(new immutable(Message)(args));

source/vibe/concurrency.d(1148): Error: can only initialize const

member expandfield_0 inside constructor

source/vibe/concurrency.d(1065): Error: template instance

vibe.core.concurrency.variantWithIsolatedSupport!(immutable(Message))

error instantiating

source/client/connection.d(54): instantiated from here:

send!(immutable(Message))

source/client/connection.d(54): Error: template instance

vibe.core.concurrency.send!(immutable(Message)) error instantiating

This was a problem with how values were packed in a
std.typecons.Tuple for sending. The latest GIT master works around
this and should function properly now
(8ab6bcc).

Sönke,

Alright. I've tried using shared classes, Isolated classes, and
immutable classes. None of them work for a variety of reasons:

shared classes <-- Don't work because of external dependencies.
Making every member variable shared, breaks too much stuff.
Isolated classes <-- I need to be able to send the same reference to
multiple threads, so .move() is out of the question.
Immutable classes <-- Can't even get them to instantiate since the
constructors have to be strongly pure. Also, I can't deserialize into
an immutable class!

How am I supposed to send complex class messages?

R/
Shammah