@@ -378,6 +378,12 @@ where {
378378 /// Blocks the current thread until next event is ready and returns it.
379379 ///
380380 /// Typically you would spawn a thread or task that calls this in a loop.
381+ ///
382+ /// **Note**: Users must handle events as soon as possible to avoid an increased event queue
383+ /// memory footprint. We will start dropping any generated events after
384+ /// [`MAX_EVENT_QUEUE_SIZE`] has been reached.
385+ ///
386+ /// [`MAX_EVENT_QUEUE_SIZE`]: crate::events::MAX_EVENT_QUEUE_SIZE
381387 #[ cfg( feature = "std" ) ]
382388 pub fn wait_next_event ( & self ) -> Event {
383389 self . pending_events . wait_next_event ( )
@@ -386,20 +392,38 @@ where {
386392 /// Returns `Some` if an event is ready.
387393 ///
388394 /// Typically you would spawn a thread or task that calls this in a loop.
395+ ///
396+ /// **Note**: Users must handle events as soon as possible to avoid an increased event queue
397+ /// memory footprint. We will start dropping any generated events after
398+ /// [`MAX_EVENT_QUEUE_SIZE`] has been reached.
399+ ///
400+ /// [`MAX_EVENT_QUEUE_SIZE`]: crate::events::MAX_EVENT_QUEUE_SIZE
389401 pub fn next_event ( & self ) -> Option < Event > {
390402 self . pending_events . next_event ( )
391403 }
392404
393405 /// Asynchronously polls the event queue and returns once the next event is ready.
394406 ///
395407 /// Typically you would spawn a thread or task that calls this in a loop.
408+ ///
409+ /// **Note**: Users must handle events as soon as possible to avoid an increased event queue
410+ /// memory footprint. We will start dropping any generated events after
411+ /// [`MAX_EVENT_QUEUE_SIZE`] has been reached.
412+ ///
413+ /// [`MAX_EVENT_QUEUE_SIZE`]: crate::events::MAX_EVENT_QUEUE_SIZE
396414 pub async fn next_event_async ( & self ) -> Event {
397415 self . pending_events . next_event_async ( ) . await
398416 }
399417
400418 /// Returns and clears all events without blocking.
401419 ///
402420 /// Typically you would spawn a thread or task that calls this in a loop.
421+ ///
422+ /// **Note**: Users must handle events as soon as possible to avoid an increased event queue
423+ /// memory footprint. We will start dropping any generated events after
424+ /// [`MAX_EVENT_QUEUE_SIZE`] has been reached.
425+ ///
426+ /// [`MAX_EVENT_QUEUE_SIZE`]: crate::events::MAX_EVENT_QUEUE_SIZE
403427 pub fn get_and_clear_pending_events ( & self ) -> Vec < Event > {
404428 self . pending_events . get_and_clear_pending_events ( )
405429 }
0 commit comments