Skip to content

class Athena::Mercure::Discovery
inherits Reference #

Allows for automatically discovering the Mercure hub via a Link header. E.g. can be included with the response for a resource to allow clients to then extract the URL from the rel mercure header to subscribe to future updates for that resource.

See Discovery for more information.

Direct known subclasses

Athena::Mercure::Bundle::Discovery

Constructors#

.new(hub_registry : AMC::Hub::Registry)#

View source

Methods#

#add_link(request : ::HTTP::Request, response : ::HTTP::Server::Response, hub_name : String | Nil = nil) : Nil#

Adds the mercure relation link header to the provided response, optionally for the provided hub_name.

View source