portage.util.futures.unix_events module

portage.util.futures.unix_events.DefaultEventLoopPolicy

alias of portage.util.futures.unix_events._AsyncioEventLoopPolicy

class portage.util.futures.unix_events._AsyncioEventLoopPolicy

Bases: portage.util.futures.unix_events._PortageEventLoopPolicy

A subclass of _PortageEventLoopPolicy which raises NotImplementedError if it is set as the real asyncio event loop policy, since this class is intended to wrap the real asyncio event loop policy.

_check_recursion()
get_child_watcher()

Get the watcher for child processes.

get_event_loop()

Get the event loop for the current context.

Returns an event loop object implementing the AbstractEventLoop interface.

Return type

asyncio.AbstractEventLoop (or compatible)

Returns

the current event loop policy

new_event_loop()

Create and return a new event loop object according to this policy’s rules. If there’s need to set this loop as the event loop for the current context, set_event_loop must be called explicitly.

set_child_watcher(watcher)

Set the watcher for child processes.

set_event_loop(loop)

Set the event loop for the current context to loop.

class portage.util.futures.unix_events._PortageEventLoopPolicy

Bases: asyncio.events.AbstractEventLoopPolicy

Implementation of asyncio.AbstractEventLoopPolicy based on portage’s internal event loop. This supports running event loops in forks, which is not supported by the default asyncio event loop policy, see https://bugs.python.org/issue22087.

get_child_watcher()

Get the watcher for child processes.

get_event_loop()

Get the event loop for the current context.

Returns an event loop object implementing the AbstractEventLoop interface.

Return type

asyncio.AbstractEventLoop (or compatible)

Returns

the current event loop policy

new_event_loop()

Create and return a new event loop object according to this policy’s rules. If there’s need to set this loop as the event loop for the current context, set_event_loop must be called explicitly.

set_child_watcher(watcher)

Set the watcher for child processes.

set_event_loop(loop)

Set the event loop for the current context to loop.

portage.util.futures.unix_events._set_nonblocking(fd)