fix: set correct node id on incoming messages

This commit is contained in:
2026-06-09 19:51:29 +02:00
parent b6e5e12770
commit 25cadc04ad
3 changed files with 70 additions and 38 deletions
+3
View File
@@ -21,6 +21,7 @@ import Data.Map qualified as Map
data Runtime = Runtime
{ rtNodeId :: NodeAddr
, rtNextNodeId :: TVar NodeId
, rtActors :: TVar (Map.Map ActorId (ThreadId, SomeActorRef))
, rtPending :: TVar (Map.Map CorrelationId (MVar ByteString))
, rtNextCorr :: TVar CorrelationId
@@ -41,10 +42,12 @@ newRuntime myAddr transport = do
pending <- newTVarIO Map.empty
nextCorr <- newTVarIO (0 :: Integer)
nodeTable <- newTVarIO Map.empty
nextNid <- newTVarIO (1 :: NodeId)
conns <- newTVarIO Map.empty
promises <- newTVarIO Map.empty
return Runtime
{ rtNodeId = myAddr
, rtNextNodeId = nextNid
, rtActors = actors
, rtPending = pending
, rtNextCorr = nextCorr