OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
python3
/
dist-packages
/
twisted
/
_threads
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/31/2022 06:22:38 AM
rwxr-xr-x
📄
__init__.py
570 bytes
09/08/2017 10:38:36 AM
rw-r--r--
📁
__pycache__
-
03/31/2022 06:22:38 AM
rwxr-xr-x
📄
_convenience.py
969 bytes
09/08/2017 10:38:36 AM
rw-r--r--
📄
_ithreads.py
1.77 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
_memory.py
1.63 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
_pool.py
2.34 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
_team.py
7.09 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
_threadworker.py
3.3 KB
09/08/2017 10:38:36 AM
rw-r--r--
📁
test
-
03/31/2022 06:22:38 AM
rwxr-xr-x
Editing: _ithreads.py
Close
# -*- test-case-name: twisted._threads.test -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Interfaces related to threads. """ from __future__ import absolute_import, division, print_function from zope.interface import Interface class AlreadyQuit(Exception): """ This worker worker is dead and cannot execute more instructions. """ class IWorker(Interface): """ A worker that can perform some work concurrently. All methods on this interface must be thread-safe. """ def do(task): """ Perform the given task. As an interface, this method makes no specific claims about concurrent execution. An L{IWorker}'s C{do} implementation may defer execution for later on the same thread, immediately on a different thread, or some combination of the two. It is valid for a C{do} method to schedule C{task} in such a way that it may never be executed. It is important for some implementations to provide specific properties with respect to where C{task} is executed, of course, and client code may rely on a more specific implementation of C{do} than L{IWorker}. @param task: a task to call in a thread or other concurrent context. @type task: 0-argument callable @raise AlreadyQuit: if C{quit} has been called. """ def quit(): """ Free any resources associated with this L{IWorker} and cause it to reject all future work. @raise: L{AlreadyQuit} if this method has already been called. """ class IExclusiveWorker(IWorker): """ Like L{IWorker}, but with the additional guarantee that the callables passed to C{do} will not be called exclusively with each other. """