Skip to content

Commit

Permalink
feat: Make AsyncQueue public for transports
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpach committed Jul 15, 2020
1 parent 02f52e7 commit 5df0d98
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Assets/Mirror/Runtime/Transport/AsyncQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ public class AsyncQueue<T>
private readonly Queue<T> queue = new Queue<T>();
private readonly SemaphoreSlim semaphore = new SemaphoreSlim(0);

internal void Enqueue(T v)
public void Enqueue(T v)
{
queue.Enqueue(v);
semaphore.Release();
}

internal async Task<T> DequeueAsync()
public async Task<T> DequeueAsync()
{
await semaphore.WaitAsync();
return queue.Dequeue();
}

internal int Count => queue.Count;
public int Count => queue.Count;

}
}

0 comments on commit 5df0d98

Please sign in to comment.