2018-07-14 20:09:05 +00:00
|
|
|
"""
|
|
|
|
Per process state
|
|
|
|
"""
|
2018-08-31 21:16:24 +00:00
|
|
|
from typing import Optional
|
2018-07-14 20:09:05 +00:00
|
|
|
|
|
|
|
|
2018-08-31 21:16:24 +00:00
|
|
|
_current_actor: Optional['Actor'] = None # type: ignore
|
|
|
|
|
|
|
|
|
|
|
|
def current_actor() -> 'Actor': # type: ignore
|
2018-07-14 20:09:05 +00:00
|
|
|
"""Get the process-local actor instance.
|
|
|
|
"""
|
2018-08-13 03:59:19 +00:00
|
|
|
if not _current_actor:
|
|
|
|
raise RuntimeError("No actor instance has been defined yet?")
|
2018-07-14 20:09:05 +00:00
|
|
|
return _current_actor
|