Skip to content

Feature Request: Expose endpoint #405

@wellcaffeinated

Description

@wellcaffeinated

Related to #372

Although there are ways of getting around this, it would make things much more convenient to expose the endpoint on a proxy property. I'm using comlink-loader, which makes it impossible to access the original WebWorker instance.

What I'd love is something like:

import { endpointMarker } from 'comlink'
import myProxy from 'webpack/magic/here'

// do a long job...
myProxy.doStuff().then(...)

// oops i want to cancel
let worker = myProxy[endpointMarker]
worker.terminate()

I imagine this would be easy enough to implement. Hoping you think so too! :)

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