struct

Athena::Mercure::Update

Inherits Struct < Value < Object

Represents an update to publish.

AMC::Update.new(
  "https://example.com/books/1",
  {status: "OutOfStock"}.to_json
)

The topic may be any string, but is recommended it be an IRI (Internationalized Resource Identifier) that uniquely identifies the resource the update related to. The data may also be any string, but will most commonly be JSON.

Private Updates

By default, an update would be sent to all subscribers listening on that topic. However, if private: true is defined on the update, then it'll only be sent to subscribers who are authorized to receive it. See Authorization for more information.

Constructors

new(topics : String | Array(String), data : String = "", private __arg0 : Bool = false, id : String | Nil = nil, type : String | Nil = nil, retry : Int32 | Nil = nil)
Source

Instance methods

data

Returns the string content of the update.

Source
id

Maps to the SSE's id property.

Source
private?

If true, the update will not be sent to subscribers who are not authorized to receive it.

Source
retry

Maps to the SSE's retry property

Source
topics

Returns the identifiers this update is associated with.

Source
type

Maps to the SSE's event property

Source