class_docstr: Like ioloop.PeriodicCallback except the 'func' can be async and return
  a Future.
  
  Will wait for func to finish each time before we call it again. (Plain
  ioloop.PeriodicCallback can "pile up" invocations if they are taking too
  long.)
class_docstr_tok: ["Like","ioloop.PeriodicCallback","except","the","'func","'","can","be","async","and","return","a","Future",".","Will","wait","for","func","to","finish","each","time","before","we","call","it","again",".","(","Plain","ioloop.PeriodicCallback","can","``","pile","up","''","invocations","if","they","are","taking","too","long",".",")"]
code: def __init__(
      self, func: Callback, period: int, io_loop: IOLoop
  ) -> None:
      # specify type here until this is released: https://github.com/python/mypy/pull/10548
      self._func: Callback = func
  
      self._loop = io_loop
      self._period = period
      self._started = False
      self._stopped = False
  
imports: from __future__ import annotations
  import logging
  import sys
  import threading
  from collections import defaultdict
  from traceback import format_exception
  from typing import TYPE_CHECKING, Any, Awaitable, Callable, Union
  import tornado
  from tornado import gen
  from ..core.types import ID
label_desc: Use image node_id 1 to create a new _AsyncPeriodic object  with example: obj = _AsyncPeriodic(func, period, io_loop)