neva icon indicating copy to clipboard operation
neva copied to clipboard

Any program that uses the same sender (port) twice or more is incorrect

Open emil14 opened this issue 4 months ago • 4 comments

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)

  1. 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))
  2. Easy - force compiler (analyzer) to always have only one connection with specific sender

Might be related to https://github.com/nevalang/neva/issues/627

emil14 avatar Feb 27 '24 16:02 emil14