Closed pancsta closed 5 days ago
To tackle select&ctx-pasta, there's new Waiting helpers
select&ctx
Example - wait for bootstrap RPC to become ready.
// err := amhelp.WaitForAll(ctx, s.ConnTimeout, boot.server.Mach.When1(ssrpc.ServerStates.RpcReady, nil)) if ctx.Err() != nil { return // expired } if err != nil { AddErrWorker(s.Mach, err, Pass(argsOut)) return }
Example - wait for Foo, Bar, or Exception.
ctx := client.Mach.NewStateCtx("Start") err := amhelp.WaitForErrAll(ctx, 1*time.Second, mach, mach.When1("Foo", nil), mach.When1("Bar", nil)) if ctx.Err() != nil { // no err return nil // expired } if err != nil { // either timeout happened or Exception has been activated return err }
Theres is more new related stuff in /pkg/helpers.
/pkg/helpers
To tackle
select&ctx
-pasta, there's new Waiting helpersExample - wait for bootstrap RPC to become ready.
Example - wait for Foo, Bar, or Exception.
Theres is more new related stuff in
/pkg/helpers
.