This document is for Kombu's development version, which can be significantly different from previous releases. Get the stable docs here: 5.3.

# Event Loop Implementation - `kombu.asynchronous.hub`

Event loop implementation.

class kombu.asynchronous.hub.Hub(timer=None)

  Event loop object.

  ## Arguments:

  > timer (kombu.asynchronous.Timer): Specify custom timer instance.

  ERR = 24

    Flag set on error, and the fd should be read from asap.

  READ = 1

    Flag set if reading from an fd will not block.

  WRITE = 4

    Flag set if writing to an fd will not block.

  add(fd, callback, flags, args=(), consolidate=False)
  add_reader(fds, callback, *args)
  add_writer(fds, callback, *args)
  call_at(when, callback, *args)
  call_later(delay, callback, *args)
  call_repeatedly(delay, callback, *args)
  call_soon(callback, *args)
  close(*args)
  create_loop(generator=<class 'generator'>, sleep=<built-in function sleep>, min=<built-in function min>, next=<built-in function next>, Empty=<class '_queue.Empty'>, StopIteration=<class 'StopIteration'>, KeyError=<class 'KeyError'>, READ=1, WRITE=4, ERR=24)
  fire_timers(min_delay=1, max_delay=10, max_timers=10, propagate=())
  property loop
  on_callback_error(callback, exc)
  on_close = None

    List of callbacks to be called when the loop is exiting, applied with the hub instance as sole argument.

  property poller
  remove(fd)
  remove_reader(fd)
  remove_writer(fd)
  repr_active()
  repr_events(events)
  reset()
  run_forever()
  run_once()
  property scheduler
  stop()

kombu.asynchronous.hub.get_event_loop() → Hub | None

  Get current event loop object.

kombu.asynchronous.hub.set_event_loop(loop: Hub | None) → Hub | None

  Set the current event loop object.