dbrattli/Expression

Actor Model & Railway oriented programming

Closed this issue · 1 comments

Mailbox Processor: for lock free programming using the Actor model.
Cancellation Token: for cancellation of asynchronous (and synchronous) workflows.
Disposable: For resource management.

Can you provide an example of how to use the Actor model with railway-oriented programming?

some_actor = ...

async def runner():
    return pipe(
        Ok(1),
        func1,
        func2,
        lambda x: some_actor.post(x),
        func3,
    )

Is the above code a suggested usage?

You can look at aioreactive for examples on how to use MailboxProcessor as an actor model e.g: https://github.com/dbrattli/aioreactive/blob/master/aioreactive/timeshift.py