Skip to content

Should code be executed asynchronously in RTC mode? #7

Closed
@Wh1isper

Description

@Wh1isper

Problem

reply = await ensure_async(
client.execute_interactive(
snippet,
output_hook=self._output_hook,
stdin_hook=self._stdin_hook if client.allow_stdin else None,
)
)

I've found that current implementations where cell takes longer to execute can lead to http request timeouts (especially behind some reverse proxies), and it's difficult for the front-end to determine if the request to execute the code was successfully sent.

Proposed Solution

  1. We can simply support asynchronous mode: do execute and safe in an asyncio.Task.
  2. Maybe we need an optimistic lock to prevent racing when concurrent write to the ynotebook.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions