Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
Register creates a new channel for a webhook path, superseding any existing registration. The newest registration owns the path: when a workflow moves between workers, the one taking the lease over is the one that should receive.
func Unregister ¶
Unregister releases a path, but only if ch is still the channel registered for it.
The ownership check is what makes a handover safe. Nothing orders the outgoing worker's teardown against the incoming worker's registration, so deleting by path alone let a worker that had already lost the lease close and remove its successor's channel. The successor was then reading from a closed channel that no longer appeared in the registry: the workflow reported itself running and never received another message.
A stale caller now finds its channel is no longer the registered one and leaves the path alone. Its own channel is simply dropped — its reader has already returned through the cancelled context, and nothing else holds it.
Types ¶
type WebhookSource ¶
type WebhookSource struct {
Path string
// contains filtered or unexported fields
}
WebhookSource implements the hermod.Source interface for receiving HTTP requests.
func NewWebhookSource ¶
func NewWebhookSource(path string) *WebhookSource
NewWebhookSource creates a new WebhookSource.
func (*WebhookSource) Close ¶
func (s *WebhookSource) Close() error
Close unregisters the source, unless another has already taken the path over.