pancsta / asyncmachine-go

AOP Actor Model for distributed workflows
https://asyncmachine.dev
MIT License
72 stars 0 forks source link

feat(rpc): add pkg/rpc #117

Closed pancsta closed 2 months ago

pancsta commented 2 months ago

This is the highlight of the v0.7 release - transparent RCP, where most of the methods execute locally. WhenArgs is still missing, but rpc is already hard at work executing remote integration tests.

// init
c, err := NewClient(ctx, addr, "clientid", ss.States, ss.Names)
if err != nil {
    panic(err)
}

// start
c.Start()
<-c.Mach.When1("Ready", nil)

// use the remote worker
c.Worker.Add1("Foo", nil)
<-c.Worker.When1("Bar", nil)
print("Server added Bar")