Skip to content

Python: run_soon_threadsafe #16

@0lru

Description

@0lru

Nice Python-like-API-approach. I started something like this some time ago and my event loop class looked pretty
much the same.

In Python, you can have multiple event loops:
See https://docs.python.org/3/library/asyncio-eventloop.html call_soon_threadsafe, set_event_loop etc.

I think it's about making this a thread_local:

EventLoop& get_event_loop() {
    static EventLoop loop;
    return loop;
}

The continuation may be a bit different as well. I'd love a combination of this API with the
multithreading-capabilities of https://github.com/David-Haim/concurrencpp.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions