class_docstr: A harness for server-specific information and tasks related to
  Bokeh sessions.
  
  *This base class is probably not of interest to general users.*
class_docstr_tok: ["A","harness","for","server-specific","information","and","tasks","related","to","Bokeh","sessions",".","*","This","base","class","is","probably","not","of","interest","to","general","users",".","*"]
docstr: Runs a function with the document lock held, passing the
  document to the function.
  
  *Subclasses must implement this method.*
  
  Args:
      func (callable): function that takes a single parameter (the Document)
          and returns ``None`` or a ``Future``
  
  Returns:
      a ``Future`` containing the result of the function
docstr_tok: ["Runs","a","function","with","the","document","lock","held",",","passing","the","document","to","the","function",".","*","Subclasses","must","implement","this","method",".","*","Args",":","func","(","callable",")",":","function","that","takes","a","single","parameter","(","the","Document",")","and","returns","``","None","``","or","a","``","Future","``","Returns",":","a","``","Future","``","containing","the","result","of","the","function"]
code: def with_locked_document(
      self, func: Callable[[Document], Awaitable[None]]
  ) -> Awaitable[None]:
      """Runs a function with the document lock held, passing the
      document to the function.
  
      *Subclasses must implement this method.*
  
      Args:
          func (callable): function that takes a single parameter (the Document)
              and returns ``None`` or a ``Future``
  
      Returns:
          a ``Future`` containing the result of the function
  
      """
      pass
  
imports: from __future__ import annotations
  import logging
  from abc import ABCMeta, abstractmethod
  from typing import TYPE_CHECKING, Any, Awaitable, Callable, ClassVar
  from ..core.types import ID
  from ..document import Document
  from ..settings import settings
label_desc: Use image node_id 5 for calling the SessionContext obj's underlying member method code with example usage: obj.with_locked_document(func) without return types