Skip to content

Add support for cancellation of potentially long-running operations #86

Open
@aryanjassal

Description

@aryanjassal

Specification

Currently, there is no way to cancel or abort an operation after it has been started. This is especially an issue for commands which can run for an arbitrarily long time. For example, the efs.readFile() can take extremely long to complete depending on the file.

If this operation is being used in, say, a RPC call, and the RPC call times out, then the operation will continue to run in the background. This will keep a connection and a file descriptor open in the background and not do anything with it, resulting in leaked resources and blocking the entire application from shutting down.

The easiest way to achieve this is to accept either a context object from js-contexts, or just accept an AbortController.signal.

Additional context

Tasks

  1. Implement support for abortion or cancellation
  2. Add tests to confirm this behaviour

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions