On Monday, 11 September 2017 at 09:56:01 UTC, Jonas Mminnberg
1. receive() pattern matching -- what is common here, always send (int, someData) where int is a value you compare to. Or create dummy types that you can match on directly?

I would always create a new type and have it hold the data.

struct SomeCommand {
  int[] data;
}

2. What is the reason you can't decide which thread(s) to receive() from and is there any way around it?

idk the reason but if you are just receiving your custom types you shouldn't have to worry about other stuff.

3. Is there a recommended way to deal with creating immutable data ? Right now I just cast to immutable before returning the data since I know I have the only reference, but it would be nice to have something like a `UniqueReference` containing a immutableMove() method...

There is http://dpldocs.info/assumeUnique which does the cast for you but I don't think it can move at all.

You can also create it in a pure function and write to an immutable variable when you initialize it.

Reply via email to