Lines Matching refs:policy
1 """Event loop and event loop policy."""
611 """Abstract policy for accessing the event loop."""
618 current context and the current policy does not specify to create one.
629 policy's rules. If there's need to set this loop as the event loop for
645 """Default policy implementation for accessing the event loop.
647 In this policy, each thread has its own event loop. However, we
698 # Event loop policy. The policy itself is always global, even if the
699 # policy's rules say that there is an event loop per thread (or other
700 # notion of context). The default policy is installed by the first
704 # Lock for protecting the on-the-fly creation of the event loop policy.
759 """Get the current event loop policy."""
765 def set_event_loop_policy(policy):
766 """Set the current event loop policy.
768 If policy is None, the default policy is restored."""
770 if policy is not None and not isinstance(policy, AbstractEventLoopPolicy):
771 raise TypeError(f"policy must be an instance of AbstractEventLoopPolicy or None, not '{type(policy).__name__}'")
772 _event_loop_policy = policy