class Webhooks
Async webhook delivery for A2A push notifications.
Following the gospel (async-http):
- Uses Async::HTTP::Internet for non-blocking HTTP requests
- Each delivery runs in its own Async task (fiber, not thread)
- Failures are logged but do not propagate
The A2A spec says:
- Push notification payloads use StreamResponse format
- Content-Type: application/a2a+json
- Authentication via scheme + credentials from the config
- Token header: X-A2A-Notification-Token
- Delivery is at-least-once with possible retries
Definitions
def deliver(configs, payload)
Deliver a payload to all push notification configs for a task.
Signature
-
parameter
configsArray(Hash) push notification configs
-
parameter
payloadHash the StreamResponse payload
Implementation
def deliver(configs, payload)
return if configs.nil? || configs.empty?
configs.each do |config|
Async do
deliver_single(config, payload)
rescue => e
Console.error(self, "Webhook delivery failed for #{config["url"]}", e)
end
end
end