class_docstr: Controls an object on a remote worker
  
  An actor allows remote control of a stateful object living on a remote
  worker.  Method calls on this object trigger operations on the remote
  object and return BaseActorFutures on which we can block to get results.
  
  Examples
  --------
  >>> class Counter:
  ...    def __init__(self):
  ...        self.n = 0
  ...    def increment(self):
  ...        self.n += 1
  ...        return self.n
  
  >>> from dask.distributed import Client
  >>> client = Client()
  
  You can create an actor by submitting a class with the keyword
  ``actor=True``.
  
  >>> future = client.submit(Counter, actor=True)
  >>> counter = future.result()
  >>> counter
  <Actor: Counter, key=Counter-1234abcd>
  
  Calling methods on this object immediately returns deferred ``BaseActorFuture``
  objects.  You can call ``.result()`` on these objects to block and get the
  result of the function call.
  
  >>> future = counter.increment()
  >>> future.result()
  1
  >>> future = counter.increment()
  >>> future.result()
  2
class_docstr_tok: ["Controls","an","object","on","a","remote","worker","An","actor","allows","remote","control","of","a","stateful","object","living","on","a","remote","worker",".","Method","calls","on","this","object","trigger","operations","on","the","remote","object","and","return","BaseActorFutures","on","which","we","can","block","to","get","results",".","Examples","--","--","--","--",">",">",">","class","Counter",":","...","def","__init__","(","self",")",":","...","self.n","=","0","...","def","increment","(","self",")",":","...","self.n","+=","1","...","return","self.n",">",">",">","from","dask.distributed","import","Client",">",">",">","client","=","Client","(",")","You","can","create","an","actor","by","submitting","a","class","with","the","keyword","``","actor=True","``",".",">",">",">","future","=","client.submit","(","Counter",",","actor=True",")",">",">",">","counter","=","future.result","(",")",">",">",">","counter","<","Actor",":","Counter",",","key=Counter-1234abcd",">","Calling","methods","on","this","object","immediately","returns","deferred","``","BaseActorFuture","``","objects",".","You","can","call","``",".result","(",")","``","on","these","objects","to","block","and","get","the","result","of","the","function","call",".",">",">",">","future","=","counter.increment","(",")",">",">",">","future.result","(",")","1",">",">",">","future","=","counter.increment","(",")",">",">",">","future.result","(",")","2"]
code: def _asynchronous(self):
      if self._client:
          return self._client.asynchronous
      else:
          return threading.get_ident() == self._worker.thread_id
  
imports: from __future__ import annotations
  import abc
  import functools
  import threading
  from collections.abc import Awaitable, Generator
  from dataclasses import dataclass
  from datetime import timedelta
  from typing import Generic, Literal, NoReturn, TypeVar
  from tornado.ioloop import IOLoop
  from distributed.client import Future
  from distributed.protocol import to_serialize
  from distributed.utils import LateLoopEvent, iscoroutinefunction, sync, thread_state
  from distributed.utils_comm import WrappedKey
  from distributed.worker import get_client, get_worker
label_desc: Use image node_id 8 for calling the Actor obj's underlying member method code with example usage: obj._asynchronous() and returns: self, unknown