class_docstr: An in-process tf.data service worker server.
  
  A `tf.data.experimental.service.WorkerServer` performs `tf.data.Dataset`
  processing for user-defined datasets, and provides the resulting elements over
  RPC. A worker is associated with a single
  `tf.data.experimental.service.DispatchServer`.
  
  >>> dispatcher = tf.data.experimental.service.DispatchServer()
  >>> dispatcher_address = dispatcher.target.split("://")[1]
  >>> worker = tf.data.experimental.service.WorkerServer(
  ...     tf.data.experimental.service.WorkerConfig(
  ...         dispatcher_address=dispatcher_address))
  >>> dataset = tf.data.Dataset.range(10)
  >>> dataset = dataset.apply(tf.data.experimental.service.distribute(
  ...     processing_mode="parallel_epochs", service=dispatcher.target))
  >>> print(list(dataset.as_numpy_iterator()))
  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  
  When starting a dedicated tf.data worker process, use join() to block
  after starting up the worker, until the worker terminates.
  
  ```
  worker = tf.data.experimental.service.WorkerServer(
      port=5051, dispatcher_address="localhost:5050")
  worker.join()
  ```
  
  Call stop() to gracefully terminate the worker. The worker automatically stops
  when all reference to it have been deleted.
class_docstr_tok: ["An","in-process","tf.data","service","worker","server",".","A","`","tf.data.experimental.service.WorkerServer","`","performs","`","tf.data.Dataset","`","processing","for","user-defined","datasets",",","and","provides","the","resulting","elements","over","RPC",".","A","worker","is","associated","with","a","single","`","tf.data.experimental.service.DispatchServer","`",".",">",">",">","dispatcher","=","tf.data.experimental.service.DispatchServer","(",")",">",">",">","dispatcher_address","=","dispatcher.target.split","(","``",":","\/\/","''",")","[","1","]",">",">",">","worker","=","tf.data.experimental.service.WorkerServer","(","...","tf.data.experimental.service.WorkerConfig","(","...","dispatcher_address=dispatcher_address",")",")",">",">",">","dataset","=","tf.data.Dataset.range","(","10",")",">",">",">","dataset","=","dataset.apply","(","tf.data.experimental.service.distribute","(","...","processing_mode=","''","parallel_epochs","''",",","service=dispatcher.target",")",")",">",">",">","print","(","list","(","dataset.as_numpy_iterator","(",")",")",")","[","0",",","1",",","2",",","3",",","4",",","5",",","6",",","7",",","8",",","9","]","When","starting","a","dedicated","tf.data","worker","process",",","use","join","(",")","to","block","after","starting","up","the","worker",",","until","the","worker","terminates",".","``","`","worker","=","tf.data.experimental.service.WorkerServer","(","port=5051",",","dispatcher_address=","''","localhost:5050","''",")","worker.join","(",")","``","`","Call","stop","(",")","to","gracefully","terminate","the","worker",".","The","worker","automatically","stops","when","all","reference","to","it","have","been","deleted","."]
docstr: Returns the number of tasks currently being executed on the worker.
docstr_tok: ["Returns","the","number","of","tasks","currently","being","executed","on","the","worker","."]
code: def _num_tasks(self) -> int:
      """Returns the number of tasks currently being executed on the worker."""
      return self._server.num_tasks()
  
imports: import collections
  from typing import Iterable
  from tensorflow.core.protobuf import service_config_pb2
  from tensorflow.python import pywrap_tensorflow
  from tensorflow.python.data.experimental.service import _pywrap_server_lib
  from tensorflow.python.data.experimental.service import _pywrap_utils
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 8 for calling the WorkerServer obj's underlying member method code with example usage: obj._num_tasks() and returns: self