This is idempotent and irreversible. No other methods should be called after
this one.
+.. _asyncio-pass-keywords:
Calls
-----
+Most :mod:`asyncio` functions don't accept keywords. If you want to pass
+keywords to your callback, use :func:`functools.partial`. For example,
+``loop.call_soon(functools.partial(print, "Hello", flush=True))`` will call
+``print("Hello", flush=True)``.
+
+.. note::
+ :func:`functools.partial` is better than ``lambda`` functions, because
+ :mod:`asyncio` can inspect :func:`functools.partial` object to display
+ parameters in debug mode, whereas ``lambda`` functions have a poor
+ representation.
+
.. method:: BaseEventLoop.call_soon(callback, \*args)
Arrange for a callback to be called as soon as possible.
An instance of :class:`asyncio.Handle` is returned.
+ :ref:`Use functools.partial to pass keywords to the callback
+ <asyncio-pass-keywords>`.
+
.. method:: BaseEventLoop.call_soon_threadsafe(callback, \*args)
Like :meth:`call_soon`, but thread safe.
is called. If you want the callback to be called with some named
arguments, use a closure or :func:`functools.partial`.
+ :ref:`Use functools.partial to pass keywords to the callback
+ <asyncio-pass-keywords>`.
+
.. method:: BaseEventLoop.call_at(when, callback, *args)
Arrange for the *callback* to be called at the given absolute timestamp
This method's behavior is the same as :meth:`call_later`.
+ :ref:`Use functools.partial to pass keywords to the callback
+ <asyncio-pass-keywords>`.
+
.. method:: BaseEventLoop.time()
Return the current time, as a :class:`float` value, according to the
Start watching the file descriptor for read availability and then call the
*callback* with specified arguments.
+ :ref:`Use functools.partial to pass keywords to the callback
+ <asyncio-pass-keywords>`.
+
.. method:: BaseEventLoop.remove_reader(fd)
Stop watching the file descriptor for read availability.
Start watching the file descriptor for write availability and then call the
*callback* with specified arguments.
+ :ref:`Use functools.partial to pass keywords to the callback
+ <asyncio-pass-keywords>`.
+
.. method:: BaseEventLoop.remove_writer(fd)
Stop watching the file descriptor for write availability.
Raise :exc:`ValueError` if the signal number is invalid or uncatchable.
Raise :exc:`RuntimeError` if there is a problem setting up the handler.
+ :ref:`Use functools.partial to pass keywords to the callback
+ <asyncio-pass-keywords>`.
+
.. method:: BaseEventLoop.remove_signal_handler(sig)
Remove a handler for a signal.
The *executor* argument should be an :class:`~concurrent.futures.Executor`
instance. The default executor is used if *executor* is ``None``.
+ :ref:`Use functools.partial to pass keywords to the callback
+ <asyncio-pass-keywords>`.
+
This method is a :ref:`coroutine <coroutine>`.
.. method:: BaseEventLoop.set_default_executor(executor)