Skip to content

class Athena::Mercure::Hub
inherits Reference #

Default implementation of AMC::Hub::Interface.

Included modules

Athena::Mercure::Hub::Interface

Constructors#

.new(url : String, token_provider : AMC::TokenProvider::Interface, token_factory : AMC::TokenFactory::Interface | Nil = nil, public_url : String | Nil = nil, http_client : ::HTTP::Client | Nil = nil, cookie_name : String | Nil = nil, protocol_version : AMC::ProtocolVersion = :v1)#

View source

Methods#

#cookie_name : String#

Returns the name of the cookie subscribers of this hub are authorized with.

View source

#protocol_version : AMC::ProtocolVersion#

Returns the version of the Mercure protocol this hub speaks.

View source

#public_url : String#

Returns the public URL of this hub used to subscribe.

View source

#publish(update : AMC::Update) : String#

Publishes the provided update to this hub.

View source

#token_factory : AMC::TokenFactory::Interface | ::Nil#

Returns the AMC::TokenFactory::Interface associated with this hub.

View source

#token_provider : AMC::TokenProvider::Interface#

Returns the AMC::TokenProvider::Interface associated with this hub.

View source

#url : String#

Returns the internal URL of this hub used to publish updates.

View source