← Back
Editing: _ithreads.cpython-38.pyc
U W[ � @ sX d Z ddlmZmZmZ ddlmZ G dd� de�ZG dd� de�Z G dd � d e �Z d S )z Interfaces related to threads. � )�absolute_import�division�print_function)� Interfacec @ s e Zd ZdZdS )�AlreadyQuitzJ This worker worker is dead and cannot execute more instructions. N��__name__� __module__�__qualname__�__doc__� r r �</usr/lib/python3/dist-packages/twisted/_threads/_ithreads.pyr s r c @ s e Zd ZdZdd� Zdd� ZdS )�IWorkerzs A worker that can perform some work concurrently. All methods on this interface must be thread-safe. c C s dS )a; 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. Nr )Ztaskr r r �do s z IWorker.doc C s dS )z� 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. Nr r r r r �quit0 s zIWorker.quitN)r r r r r r r r r r r s r c @ s e Zd ZdZdS )�IExclusiveWorkerz� Like L{IWorker}, but with the additional guarantee that the callables passed to C{do} will not be called exclusively with each other. Nr r r r r r 9 s r N)r Z __future__r r r Zzope.interfacer � Exceptionr r r r r r r �<module> s $
Save File
Cancel