Class: RoboliteKernel¶
robolite-kernel.RoboliteKernel
A kernel that executes Python code with Pyodide.
Hierarchy¶
-
↳
RoboliteKernel
Implements¶
Constructors¶
constructor¶
• new RoboliteKernel(options)
Instantiate a new PyodideKernel
Parameters¶
Name |
Type |
Description |
|---|---|---|
|
The instantiation options for a new PyodideKernel |
Overrides¶
Defined in¶
packages/robolite-kernel/lib/kernel.d.ts:12
Properties¶
_executeDelegate¶
• Private _executeDelegate: any
Defined in¶
packages/robolite-kernel/lib/kernel.d.ts:107
_processWorkerMessage¶
• Private _processWorkerMessage: any
Process a message coming from the pyodide web worker.
param The worker message to process.
Defined in¶
packages/robolite-kernel/lib/kernel.d.ts:35
_ready¶
• Private _ready: any
Defined in¶
packages/robolite-kernel/lib/kernel.d.ts:109
_sendRequestMessageToWorker¶
• Private _sendRequestMessageToWorker: any
Send a message to the web worker
param The message type to send to the worker.
param The message to send to the worker.
Defined in¶
packages/robolite-kernel/lib/kernel.d.ts:106
_worker¶
• Private _worker: any
Defined in¶
packages/robolite-kernel/lib/kernel.d.ts:108
Accessors¶
disposed¶
• get disposed(): ISignal<this, void>
A signal emitted when the kernel is disposed.
Returns¶
ISignal<this, void>
Implementation of¶
Inherited from¶
BaseKernel.disposed
Defined in¶
packages/kernel/lib/kernel.d.ts:25
executionCount¶
• get executionCount(): number
The current execution count
Returns¶
number
Inherited from¶
BaseKernel.executionCount
Defined in¶
packages/kernel/lib/kernel.d.ts:37
id¶
• get id(): string
Get the kernel id
Returns¶
string
Implementation of¶
Inherited from¶
BaseKernel.id
Defined in¶
packages/kernel/lib/kernel.d.ts:29
isDisposed¶
• get isDisposed(): boolean
Return whether the kernel is disposed.
Returns¶
boolean
Implementation of¶
Inherited from¶
BaseKernel.isDisposed
Defined in¶
packages/kernel/lib/kernel.d.ts:21
name¶
• get name(): string
Get the name of the kernel
Returns¶
string
Implementation of¶
Inherited from¶
BaseKernel.name
Defined in¶
packages/kernel/lib/kernel.d.ts:33
parent¶
• get parent(): undefined | IMessage<MessageType>
Get the last parent message (mimic ipykernel’s get_parent)
Returns¶
undefined | IMessage<MessageType>
Inherited from¶
BaseKernel.parent
Defined in¶
packages/kernel/lib/kernel.d.ts:45
parentHeader¶
• get parentHeader(): undefined | IHeader<MessageType>
Get the last parent header
Returns¶
undefined | IHeader<MessageType>
Inherited from¶
BaseKernel.parentHeader
Defined in¶
packages/kernel/lib/kernel.d.ts:41
ready¶
• get ready(): Promise<void>
A promise that is fulfilled when the kernel is ready.
Returns¶
Promise<void>
Implementation of¶
Overrides¶
BaseKernel.ready
Defined in¶
packages/robolite-kernel/lib/kernel.d.ts:29
Methods¶
buildWorkerScript¶
▸ Protected buildWorkerScript(options): string[]
Build a list of literal strings to use in the worker
Subclasses could use overload this to customize pre-loaded behavior, replace the worker, or any number of other tricks.
Parameters¶
Name |
Type |
Description |
|---|---|---|
|
The instantiation options for a new PyodideKernel |
Returns¶
string[]
Defined in¶
packages/robolite-kernel/lib/kernel.d.ts:21
clearOutput¶
▸ Protected clearOutput(content, parentHeader?): void
Send a clear_output message to the client.
Parameters¶
Name |
Type |
Description |
|---|---|---|
|
|
The clear_output content. |
|
|
- |
|
|
The parent header. |
Returns¶
void
Inherited from¶
Defined in¶
packages/kernel/lib/kernel.d.ts:170
commClose¶
▸ commClose(msg): Promise<void>
Send an comm_close message.
Parameters¶
Name |
Type |
|---|---|
|
|
Returns¶
Promise<void>
Overrides¶
Defined in¶
packages/robolite-kernel/lib/kernel.d.ts:99
commInfoRequest¶
▸ commInfoRequest(content): Promise<ReplyContent<ICommInfoReply>>
Handle a comm_info_request message.
Parameters¶
Name |
Type |
Description |
|---|---|---|
|
|
The content of the request. |
|
|
The comm target name to filter returned comms |
Returns¶
Promise<ReplyContent<ICommInfoReply>>
A promise that resolves with the response message.
Overrides¶
Defined in¶
packages/robolite-kernel/lib/kernel.d.ts:75
commMsg¶
▸ commMsg(msg): Promise<void>
Send an comm_msg message.
Parameters¶
Name |
Type |
Description |
|---|---|---|
|
|
The comm_msg message. |
Returns¶
Promise<void>
Overrides¶
Defined in¶
packages/robolite-kernel/lib/kernel.d.ts:93
commOpen¶
▸ commOpen(msg): Promise<void>
Send an comm_open message.
Parameters¶
Name |
Type |
Description |
|---|---|---|
|
|
The comm_open message. |
Returns¶
Promise<void>
Overrides¶
Defined in¶
packages/robolite-kernel/lib/kernel.d.ts:87
completeRequest¶
▸ completeRequest(content): Promise<ReplyContent<ICompleteReply>>
Handle an complete_request message
Parameters¶
Name |
Type |
|---|---|
|
|
|
|
|
|
Returns¶
Promise<ReplyContent<ICompleteReply>>
Overrides¶
Defined in¶
packages/robolite-kernel/lib/kernel.d.ts:51
displayData¶
▸ Protected displayData(content, parentHeader?): void
Send a display_data message to the client.
Parameters¶
Name |
Type |
Description |
|---|---|---|
|
|
The display_data content. |
|
|
- |
|
|
- |
|
|
- |
|
|
- |
|
|
The parent header. |
Returns¶
void
Inherited from¶
Defined in¶
packages/kernel/lib/kernel.d.ts:135
dispose¶
▸ dispose(): void
Dispose the kernel.
Returns¶
void
Implementation of¶
Overrides¶
Defined in¶
packages/robolite-kernel/lib/kernel.d.ts:25
executeRequest¶
▸ executeRequest(content): Promise<IReplyErrorContent & IExecuteCount & IReplyAbortContent & IExecuteCount & IExecuteReply & IExecuteCount>
Handle an execute_request message
Parameters¶
Name |
Type |
Description |
|---|---|---|
|
|
- |
|
|
Whether to allow stdin requests. The default is |
|
|
The code to execute. |
|
|
Whether to execute the code as quietly as possible. The default is |
|
|
Whether to the abort execution queue on an error. The default is |
|
|
Whether to store history of the execution. The default |
|
|
A mapping of names to expressions to be evaluated in the kernel’s interactive namespace. |
Returns¶
Promise<IReplyErrorContent & IExecuteCount & IReplyAbortContent & IExecuteCount & IExecuteReply & IExecuteCount>
Overrides¶
Defined in¶
packages/robolite-kernel/lib/kernel.d.ts:45
handleComm¶
▸ Protected handleComm(type, content, metadata, buffers, parentHeader?): void
Send a comm message to the client.
Parameters¶
Name |
Type |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns¶
void
Inherited from¶
Defined in¶
packages/kernel/lib/kernel.d.ts:176
handleMessage¶
▸ handleMessage(msg): Promise<void>
Handle an incoming message from the client.
Parameters¶
Name |
Type |
Description |
|---|---|---|
|
|
The message to handle |
Returns¶
Promise<void>
Implementation of¶
Inherited from¶
Defined in¶
packages/kernel/lib/kernel.d.ts:55
inputReply¶
▸ inputReply(content): void
Send an input_reply message.
Parameters¶
Name |
Type |
Description |
|---|---|---|
|
|
The content of the reply. |
Returns¶
void
Overrides¶
Defined in¶
packages/robolite-kernel/lib/kernel.d.ts:81
inputRequest¶
▸ Protected inputRequest(content, parentHeader?): void
Send a input_request message to the client.
Parameters¶
Name |
Type |
Description |
|---|---|---|
|
|
The input_request content. |
|
|
Whether the request is for a password. If so, the frontend shouldn’t echo input. |
|
|
The text to show at the prompt. |
|
|
The parent header. |
Returns¶
void
Inherited from¶
Defined in¶
packages/kernel/lib/kernel.d.ts:142
inspectRequest¶
▸ inspectRequest(content): Promise<ReplyContent<IInspectReply>>
Handle an inspect_request message.
Parameters¶
Name |
Type |
Description |
|---|---|---|
|
|
The content of the request. |
|
|
- |
|
|
- |
|
|
- |
Returns¶
Promise<ReplyContent<IInspectReply>>
A promise that resolves with the response message.
Overrides¶
Defined in¶
packages/robolite-kernel/lib/kernel.d.ts:59
isCompleteRequest¶
▸ isCompleteRequest(content): Promise<ReplyContent<IIsCompleteReplyIncomplete | IIsCompleteReplyOther>>
Handle an is_complete_request message.
Parameters¶
Name |
Type |
Description |
|---|---|---|
|
|
The content of the request. |
|
|
- |
Returns¶
Promise<ReplyContent<IIsCompleteReplyIncomplete | IIsCompleteReplyOther>>
A promise that resolves with the response message.
Overrides¶
Defined in¶
packages/robolite-kernel/lib/kernel.d.ts:67
kernelInfoRequest¶
▸ kernelInfoRequest(): Promise<ReplyContent<IInfoReply>>
Handle a kernel_info_request message
Returns¶
Promise<ReplyContent<IInfoReply>>
Overrides¶
Defined in¶
packages/robolite-kernel/lib/kernel.d.ts:39
publishExecuteError¶
▸ Protected publishExecuteError(content, parentHeader?): void
Send an error message to the client.
Parameters¶
Name |
Type |
Description |
|---|---|---|
|
|
The error content. |
|
|
- |
|
|
- |
|
|
- |
|
|
The parent header. |
Returns¶
void
Inherited from¶
Defined in¶
packages/kernel/lib/kernel.d.ts:156
publishExecuteResult¶
▸ Protected publishExecuteResult(content, parentHeader?): void
Send an execute_result message.
Parameters¶
Name |
Type |
Description |
|---|---|---|
|
|
The execute result content. |
|
|
- |
|
|
- |
|
|
- |
|
|
- |
|
|
- |
|
|
The parent header. |
Returns¶
void
Inherited from¶
Defined in¶
packages/kernel/lib/kernel.d.ts:149
stream¶
▸ Protected stream(content, parentHeader?): void
Stream an event from the kernel
Parameters¶
Name |
Type |
Description |
|---|---|---|
|
|
The stream content. |
|
|
- |
|
|
- |
|
|
The parent header. |
Returns¶
void
Inherited from¶
Defined in¶
packages/kernel/lib/kernel.d.ts:128
updateDisplayData¶
▸ Protected updateDisplayData(content, parentHeader?): void
Send a update_display_data message to the client.
Parameters¶
Name |
Type |
Description |
|---|---|---|
|
{ |
The update_display_data content. |
|
|
The parent header. |
Returns¶
void
Inherited from¶
Defined in¶
packages/kernel/lib/kernel.d.ts:163