Documentation

Worker SDK Example

Process OSS events with the Worker SDK.

Use the Worker SDK to subscribe to emitted topics from your self-hosted server. The examples in example/ match the README guides.

go run ./example/github/worker/main.go --config config.yaml --driver amqp

You can also build custom workers with the SDK:

wk := worker.New(
  worker.WithSubscriber(sub),
  worker.WithTopics("pr.opened.ready", "pr.merged"),
  worker.WithClientProvider(worker.NewSCMClientProvider(cfg.Providers)),
)

wk.HandleTopic("pr.opened.ready", func(ctx context.Context, evt *worker.Event) error {
  gh, ok := worker.GitHubClient(evt)
  if ok {
    _ = gh
  }
  return nil
})

See docs/sdk_clients.md for client injection patterns and provider resolution.