Skip to main content

Synchronization & Advanced Patterns

Coordinating with Event

0:00
LearnStep 1/4

Event Basics

Event: Signal Between Coroutines

An Event is a simple signaling primitive - it's either set or not:

python

Key Methods

  • event.set() - Set the event (wake all waiters)
  • event.clear() - Reset to unset state
  • event.is_set() - Check if set
  • await event.wait() - Wait until set