question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

synchronous Event set

See original GitHub issue

I’d like to use anyio for compatibility across asyncio and Trio, but async Event.set() (due to Curio) is a non-starter. Event is a widely use primitive. I’m guessing that an async set() would double the number of functions needing to be async in my program, and hence greatly increase the race conditions I’d need to ponder. It’s advised in “The Function Colour Myth” to keep async function percentage to a minimum.

It’s not like I’m explicitly opting to not support Curio either, because my intended use case depends on Quart, which itself only supports asyncio and Trio.

It seems like there could just be a synchronous_set() method in the ABC, and Curio could raise NotImplementedError. Isn’t there already precedent with FileStreamWrapper.send_eof()?.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:64 (39 by maintainers)

github_iconTop GitHub Comments

1reaction
agronholmcommented, Feb 8, 2021

Now that the decision was made to not implement this in the 2.x series, but rather in 3.0 in which curio is no more, I take it we don’t want the backwards dummy awaitable for backwards compatibility? The incompatible API changes will of course be documented in the changelog.

1reaction
agronholmcommented, Dec 30, 2020

Yes, though I’d very much prefer for the sync replacement functions (i.e. Event.set and friends) to return a deprecation-warning awaitable until 4.0 (or possibly 3.1). While I could convert all my anyio code all at once, I’d very much prefer not to have to.

Yeah, this is the plan.

Read more comments on GitHub >

github_iconTop Results From Across the Web

About Synchronicity, Application Event System
Application events are synchronous when they must execute their handlers in a ... and the system is set to ignore failures for that...
Read more >
Invoking Event Handlers Synchronously or Asynchronously
By default, Integration Server invokes event handlers that subscribe to events synchronously. Once the event handler is invoked, Integration Server waits ...
Read more >
Asynchronous vs. Synchronous Events ⚖️ - Epoch
On the other hand, a synchronous event occurs when all attendees participate at the same time. Synchronous events are the more traditional kind...
Read more >
Receiving Synchronous and Semisynchronous Event ...
To receive semisynchronous event notification in C++. Set up the application with calls to the CoInitializeEx and CoInitializeSecurity ...
Read more >
javascript - What does it mean that all event handlers are fired ...
The EventEmitter class is synchronous in regard to the emit function: event handlers are called synchronously from within the .emit() call, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found