forked from M-Labs/artiq
worker: add note about correct use of close()
This commit is contained in:
parent
d73006652b
commit
78f9268277
|
@ -75,6 +75,11 @@ class Worker:
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def close(self):
|
def close(self):
|
||||||
|
"""Interrupts any I/O with the worker process and terminates the
|
||||||
|
worker process.
|
||||||
|
|
||||||
|
This method should always be called by the user to clean up, even if
|
||||||
|
prepare() raises an exception."""
|
||||||
self.closed.set()
|
self.closed.set()
|
||||||
yield from self.io_lock.acquire()
|
yield from self.io_lock.acquire()
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue