neva
neva copied to clipboard
Any program that uses the same sender (port) twice or more is incorrect
Because runtime implements sort-of pub-sub algorithm based on spawning a goroutine per connection where connection is one sender -> multiple receivers.
If we have e.g. 2 connections with the same foo:bar
receiver, then we got 2 goroutines each receiving from foo:bar
. So we miss message in one of these two goroutines.
We have 2 ways to fix this, easy and hard (I like the easy one, it's good for language API)
- Hard - merge all connections with the same sender into one big connections (could not be easy or even possible due to existing of then connections, can we mix them with normal ones? isn't it a problem in general (not related to this issue))
- Easy - force compiler (analyzer) to always have only one connection with specific sender
Might be related to https://github.com/nevalang/neva/issues/627