struct
Athena::Mercure::Update
- Athena::Mercure::Update
- Struct
- Value
- Object
Overview
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.
Defined in:
update.crConstructors
Instance Method Summary
-
#data : String
Returns the string content of the update.
-
#id : String | Nil
Maps to the SSE's id property.
-
#private? : Bool
If
true, the update will not be sent to subscribers who are not authorized to receive it. -
#retry : Int32 | Nil
Maps to the SSE's retry property
-
#topics : Array(String)
Returns the identifiers this update is associated with.
-
#type : String | Nil
Maps to the SSE's event property
Constructor Detail
Instance Method Detail
If true, the update will not be sent to subscribers who are not authorized to receive it.