async_kernel.asyncshell
Classes:
- 
          AsyncDisplayHook–A displayhook subclass that publishes data using ZeroMQ. 
- 
          AsyncDisplayPublisher–A display publisher that publishes data using a ZeroMQ PUB socket. 
- 
          AsyncInteractiveShell–An IPython InteractiveShell modified to work with Async kernel. 
    
              Bases: DisplayHook
A displayhook subclass that publishes data using ZeroMQ.
This is intended to work with an InteractiveShell instance. It sends a dict of different representations of the object.
Methods:
- 
            start_displayhook–Start the display hook. 
- 
            write_output_prompt–Write the output prompt. 
- 
            write_format_data–Write format data to the message. 
- 
            finish_displayhook–Finish up all displayhook activities. 
start_displayhook() -> None
Start the display hook.
Source code in src/async_kernel/asyncshell.py
              | 49 50 51 52 |  | 
write_output_prompt() -> None
Write the output prompt.
Source code in src/async_kernel/asyncshell.py
              | 54 55 56 57 |  | 
write_format_data(format_dict, md_dict=None) -> None
Write format data to the message.
Source code in src/async_kernel/asyncshell.py
              | 59 60 61 62 63 |  | 
finish_displayhook() -> None
Finish up all displayhook activities.
Source code in src/async_kernel/asyncshell.py
              | 65 66 67 68 69 70 |  | 
AsyncDisplayPublisher(shell=None, *args, **kwargs)
              Bases: DisplayPublisher
A display publisher that publishes data using a ZeroMQ PUB socket.
Methods:
- 
            publish–Publish a display-data message. 
- 
            clear_output–Clear output associated with the current execution (cell). 
- 
            register_hook–Register a hook for when publish is called. 
Source code in src/async_kernel/asyncshell.py
                    | 78 79 80 |  | 
publish(
    data: dict[str, Any],
    metadata: dict | None = None,
    *,
    transient: dict | None = None,
    update: bool = False,
    **kwargs,
) -> None
Publish a display-data message.
Parameters:
- 
(data¶dict[str, Any]) –A mime-bundle dict, keyed by mime-type. 
- 
(metadata¶dict | None, default:None) –Metadata associated with the data. 
- 
(transient¶dict | None, default:None) –Transient data that may only be relevant during a live display, such as display_id. Transient data should not be persisted to documents. 
- 
(update¶bool, default:False) –If True, send an update_display_data message instead of display_data. 
Source code in src/async_kernel/asyncshell.py
              | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |  | 
    Clear output associated with the current execution (cell).
Parameters:
- 
(wait¶bool, default:False) –If True, the output will not be cleared immediately, instead waiting for the next display before clearing. This reduces bounce during repeated clear & display loops. 
Source code in src/async_kernel/asyncshell.py
              | 116 117 118 119 120 121 122 123 124 125 126 |  | 
    Register a hook for when publish is called.
The hook should return the message or None.
Only return None when the message should not be sent.
Source code in src/async_kernel/asyncshell.py
              | 128 129 130 131 132 133 134 |  | 
    
              Bases: InteractiveShell
An IPython InteractiveShell modified to work with Async kernel.
Notable differences
- All execute requests are run asynchronously.
- 
Supports a soft timeout with the metadata {"timeout": }1. 
- 
Not all features are support (see "not-supported" features listed below). 
- 
When the execution time exceeds the timeout value, the code execution will "move on". ↩ 
Methods:
- 
            run_cell_async–Run a complete IPython cell asynchronously. 
- 
            init_magics–Initialize magics. 
Attributes:
- 
          execute_request_timeout–A timeout in seconds to complete execute requests. 
- 
          run_cell–not-supported 
- 
          loop_runner_map–not-supported 
- 
          loop_runner–not-supported 
- 
          debug–not-supported 
- 
          readline_use–not-supported 
- 
          autoindent–not-supported 
- 
          kernel(Kernel) –The current kernel. 
class-attribute
      instance-attribute
  
¶
execute_request_timeout = CFloat(default_value=None, allow_none=True)
A timeout in seconds to complete execute requests.
async
  
¶
run_cell_async(
    raw_cell: str,
    store_history=False,
    silent=False,
    shell_futures=True,
    *,
    transformed_cell: str | None = None,
    preprocessing_exc_tuple: tuple | None = None,
    cell_id: str | None = None,
) -> ExecutionResult
Run a complete IPython cell asynchronously.
This function runs execute requests for the kernel wrapping InteractiveShell.
Source code in src/async_kernel/asyncshell.py
              | 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |  | 
init_magics() -> None
Initialize magics.
Source code in src/async_kernel/asyncshell.py
              | 295 296 297 298 299 |  | 
    
              Bases: Magics
Extra magics for async kernel.
Methods:
- 
            connect_info–Print information for connecting other clients to this kernel. 
- 
            callers–Print a table of Callers, indicating its status including: -running - protected - on the current thread. 
connect_info(_) -> None
Print information for connecting other clients to this kernel.
Source code in src/async_kernel/asyncshell.py
              | 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |  | 
callers(_) -> None
Print a table of Callers, indicating its status including: -running - protected - on the current thread.
Source code in src/async_kernel/asyncshell.py
              | 330 331 332 333 334 335 336 337 338 339 |  |