forked from busterwood/Channels
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6719718
commit 2977450
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# BusterWood.Channels | ||
Async CSP-like channels for .NET 4.6 or above. | ||
|
||
The `Channel<T>` has the following methods: | ||
|
||
* `T Receive()` reads a value from the channel, blocking until a sender has sent a value. | ||
* `Task<T> ReceiveAsync()` reads a value from the channel, the returned task will only complete when a sender has written the value to the channel. | ||
* `bool TryReceive(out T)` attempts to read a value from the channel, returns FALSE is no sender is ready. | ||
* `void Send(T)` writes a value to the channel, blocking until a receiver has got the value. | ||
* `Task SendAsync(T)` writes a value to the channel, the returned task will only complete when a receiver has got the value. | ||
* `bool TrySend(T)` attempts to write a value to the channel, returns FALSE is no receiver is ready. | ||
* `void Close()` prevents any further attempts to send to the channel | ||
* `bool IsClosed` has the channel been closed? |