Skip to content

Commit

Permalink
publish wait
Browse files Browse the repository at this point in the history
  • Loading branch information
rogeralsing committed Dec 10, 2023
1 parent 8385f6f commit 8f26fd4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Proto.Actor/EventStream/EventStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

using System;
using System.Collections.Concurrent;
using System.Threading;
using System.Threading.Channels;
using System.Threading.Tasks;
using JetBrains.Annotations;
Expand Down Expand Up @@ -72,6 +73,11 @@ internal EventStream(ActorSystem system)

public override void Publish(object msg)
{
if (_pid == null)
{
SpinWait.SpinUntil(() => _pid != null);
}

foreach (var sub in Subscriptions.Values)
{
var action = () =>
Expand Down

0 comments on commit 8f26fd4

Please sign in to comment.