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.

Make Event an Awaitable[None]

See original GitHub issue

Make cocotb.triggers.Event an Awaitable[None]. Supply an __await__ implementation that proxies event.wait() and returns None.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
ktbarrettcommented, Jun 20, 2021

I opened another bug report since the original bug report included the suggestion of deprecating wait(), which I don’t think they would ever agree to.

0reactions
eric-wiesercommented, Jun 20, 2021

Thanks for filing that bpo issue and closing the PR. I’m happy to keep this issue open for now, especially while your new issue on bpo is open.

You would have to know it’s an Event, meaning a special case would have to be added to handle them.

I don’t understand this argument - if you find yourself trying to add this special case, it means that your caller forgot to call .wait() before passing you the object.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to make python await for "nothing", running the event ...
Although instead of constantly calling it you may go another way: run your blocking code in another thread using run_in_executor and awaiting ...
Read more >
Async/Await - Best Practices in Asynchronous Programming
This article presents nothing new, as the same advice can be found online in ... The differences in semantics make sense for asynchronous...
Read more >
Coroutines and Tasks — Python 3.11.1 documentation
Coroutines, Awaitables, Creating Tasks, Task Cancellation, Task Groups, Sleeping, ... import asyncio import time async def say_after(delay, what): await ...
Read more >
for await...of - JavaScript - MDN Web Docs
The for await...of statement creates a loop iterating over async iterable ... To make finally blocks of a sync generator always called, ...
Read more >
Using async and await — Flask Documentation (2.2.x)
When a request comes in to an async view, Flask will start an event loop in a ... for example to make multiple...
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