concurrency 0.0.1

concurrency library


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

Structured Concurrency

Provides various primitives useful for structured concurrency and async tasks.

StopToken

See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2175r0.html for a thorough explanation for why we need stop tokens in particular and cancellation in general.

StopTokens are thread-safe objects used to request cancellation. They can be polled or subscribed to.

Senders/Receivers

See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p0443r14.html for the C++ proposal for introducing Senders/Receivers.

A Sender is a lazy Task (in the general sense of the word). It needs to be connected to a Receiver and then started before it will (eventually) call one of the three receiver methods: setValue, setDone, setError.

It can be used to model many asynchronous operations. It enforces structured concurrency because a Sender cannot start without it being awaited on.

Operations

The basic operation is sync_wait. It takes a Sender and blocks the currency execution context until the Sender is completed. It then returns or throws anything the Sender has send, if any.

Authors:
  • skoppe
Dependencies:
concepts
Versions:
5.0.5 2024-Jan-16
5.0.4 2023-Sep-25
5.0.3 2023-Apr-12
5.0.2 2022-Oct-28
5.0.1 2022-Oct-25
Show all 106 versions
Download Stats:
  • 1 downloads today

  • 9 downloads this week

  • 34 downloads this month

  • 137149 downloads total

Score:
2.1
Short URL:
concurrency.dub.pm