async v0.2.0 — write Go concurrency like JavaScript #1
burrows99
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
async maps the JavaScript concurrency model — Promises, async/await,
Promise.all,AbortController— onto idiomatic Go with generics, while goroutines andcontext.Contextrun underneath. Zero dependencies.It's an onboarding ramp for developers coming from JavaScript who think in Promises but are relearning goroutines and channels — built for the 90% "fan out and gather" case, not a replacement for channels.
Packages (organized by JS concept):
promise—New,Await,Then,Finally,All/All2–All8,Race,AllSettled,Any,Retry,Timeoutabort—Controller,Signal(AbortController / AbortSignal)collections—Map,ForEach,Concurrency,Queue(p-map / p-queue)timers—SetTimeout,SetInterval,Debounce,ThrottlePanic safety and opt-in cancellation are built in, and errors stay Go-shaped (
(T, error),errors.Is/errors.As).New to Go from JavaScript? The Coming from JavaScript guide shows every pattern side by side with raw Go — and is honest about where the ramp ends.
go get github.com/burrows99/asyncFeedback very welcome — especially on whether the API feels intuitive coming from JavaScript.
All reactions