auto
  7   	ˆl–Ðz¾”*i?u8 q¶î4â˜´o‘äÇò 8à
éZrG†ÛÿÏÊƒh¹ÉÇÆ      	disabled
  7   ˆl–Ãa¾””Ò~ê
€fãOÜh*bÑ¿�þDàY¹ ô­¾Øe• ?Ëƒ}ÖCÊÉÈÇ &    # -*- coding: utf-8 -*-
# Copyright (c) 2018 gevent contributors. See LICENSE for details.
"""
Interfaces gevent uses that don't belong any one place.

This is not a public module, these interfaces are not
currently exposed to the public, they mostly exist for
documentation and testing purposes.

.. versionadded:: 1.3b2

"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import sys

from zope.interface import Interface
from zope.interface import Attribute

_text_type = type(u'')

try:
    from zope import schema
except ImportError: # pragma: no cover
    class _Field(Attribute):
        __allowed_kw__ = ('readonly', 'min',)
        def __init__(self, description, required=False, **kwargs):
            description = u"%s (required? %s)" % (description, required)
            assert isinstance(description, _text_type)
            for k in self.__allowed_kw__:
                kwargs.pop(k, None)
            if kwargs:
                raise TypeError("Unexpected keyword arguments: %r" % (kwargs,))
            Attribute.__init__(self, description)

    class schema(object):
        Bool = _Field
        Float = _Field


# pylint:disable=no-method-argument, unused-argument, no-self-argument
# pylint:disable=inherit-non-class

__all__ = [
    'ILoop',
    'IWatcher',
    'ICallback',
]

class ILoop(Interface):
    """
    The common interface expected for all event loops.

    .. caution::
       This is an internal, low-level interface. It may change
       between minor versions of gevent.

    .. rubric:: Watchers

    The methods that create event loop watchers are `io`, `timer`,
    `signal`, `idle`, `prepare`, `check`, `fork`, `async_`, `child`,
    `stat`. These all return various types of :class:`IWatcher`.

    All of those methods have one or two common arguments. *ref* is a
    boolean saying whether the event loop is allowed to exit even if
    this watcher is still started. *priority* is event loop specific.
    """

    default = schema.Bool(
        description=u"Boolean indicating whether this is the default loop",
        required=True,
        readonly=True,
    )

    approx_timer_resolution = schema.Float(
        description=u"Floating point number of seconds giving (approximately) the minimum "
        "resolution of a timer (and hence the minimun value the sleep can sleep for). "
        "On libuv, this is fixed by the library, but on libev it is just a guess "
        "and the actual value is system dependent.",
        required=True,
        min=0.0,
        readonly=True,
    )

    def run(nowait=False, once=False):
        """
        Run the event loop.

        This is usually called automatically by the hub greenlet, but
        in special cases (when the hub is *not* running) you can use
        this to control how the event loop runs (for example, to integrate
        it with another event loop).
        """

    def now():
        """
        now() -> float

        Return the loop's notion of the current time.

        This may not necessarily be related to :func:`time.time` (it
        may have a different starting point), but it must be expressed
        in fractional seconds (the same *units* used by :func:`time.time`).
        """

    def update_now():
        """
        Update the loop's notion of the current time.

        .. versionadded:: 1.3
           In the past, this available as ``update``. This is still available as
           an alias but will be removed in the future.
        """

    def destroy():
        """
        Clean up resources used by this loop.

        If you create loops
        (especially loops that are not the default) you *should* call
        this method when you are done with the loop.

        .. caution::

            As an implementation note, the libev C loop implementation has a
            finalizer (``__del__``) that destroys the o