I’ve revealed the primary public launch candidate of pi-go, an MIT-licensed Go library for working brokers inside an present service. I needed the host to maintain management of identification, storage, instruments, and the mannequin, whereas the runtime coordinates every run. The core makes use of solely the usual library; the supplier and database adapters are separate modules.
The case I needed to make straightforward to check is a device name that wants human approval. The runtime waits with out working the device. Recording an approval nonetheless doesn’t run it. The host explicitly resumes the run, and within the instance the device runs as soon as. That separation lets the host resolve how and when work continues slightly than tying execution to the approval handler. Downstream idempotency nonetheless belongs to the host.
In an present Go module (Go 1.23.7+):
go get github.com/qdxiao/pi-go@v1.0.0-rc.1
From a checkout, this check workouts the approval/resume instance with out mannequin credentials:
go -C assessments/tutorial check -run '^TestApprovalRequiresHostDecisionAndExplicitResume$' -v
What occurs if the employee dies?
A separate SQLite restoration check exits and restarts actual employee processes at three factors. The toughest case is when the distant service has acted however the employee exits earlier than saving the consequence. The runtime suspends as a substitute of silently replaying the decision. If the host explicitly retries, the decision retains the identical CallID; the mock downstream service deduplicates on that ID. Actual downstream companies want their very own idempotency.
From the repo root, with CGO and a C compiler (no API key or exterior database):
go -C assessments/restoration check -count=1 -run '^TestProcessDeathRemoteEffectAndResume$/^sqlite this in a Go service, the place do you place the boundary between recording a choice and scheduling resumed work? The API remains to be at RC stage, so examples of awkward integration factors are helpful.
That is my challenge. AI helped put together this put up. -v
You probably have carried out this in a Go service, the place do you place the boundary between recording a choice and scheduling resumed work? The API remains to be at RC stage, so examples of awkward integration factors are helpful.
That is my challenge. AI helped put together this put up.

