Passing large amounts of data between actors without making copies

Yeah, so ideally what you’d do here is flag that the values have to stay disconnected while they’re stored on the actor, and that is just a feature we don’t have yet. CC’ing @Michael_Gottesman.

As a general rule, you shouldn’t feel bad about using unsafe escape hatches when you need them. I always say that the right way of understanding unsafe features is that there’s a correctness condition that the language isn’t smart enough to take over responsibility for yet. Write your code in as safely-structured a way as you can right now, documenting the preconditions and assumptions that make it actually correct. The goal should be that you know exactly what feature would let you write this safely, such that you could immediately adopt it when it’s available.

14 Likes