Class: ZZQ::Persistence::Interface
- Inherits:
-
Object
- Object
- ZZQ::Persistence::Interface
- Defined in:
- lib/zzq/persistence/interface.rb
Overview
Abstract base for persistence backends.
Concrete backends (Memory, PStore, future Redis/SQLite) implement the methods below. Broker state calls through this interface; the in-memory runtime state in Routing::Broker is the source of truth during a session, and the backend is the durable record that survives restarts.
v1 scope: retained messages only. Session persistence will land alongside session-expiry (M8’s deferred piece).
Instance Method Summary collapse
-
#clear_retained ⇒ Object
Wipe all retained state.
-
#delete_retained(_topic) ⇒ Object
Remove the retained message for
topic(zero-length-payload rule, MQTT-3.3.1-6). -
#load_retained ⇒ Object
Yields each persisted Message (retained).
-
#save_retained(_message) ⇒ Object
Persist a retained message under
message.topic.
Instance Method Details
#clear_retained ⇒ Object
Wipe all retained state. Mostly for tests and operator tooling.
38 39 40 |
# File 'lib/zzq/persistence/interface.rb', line 38 def clear_retained raise NotImplementedError end |
#delete_retained(_topic) ⇒ Object
Remove the retained message for topic (zero-length-payload rule, MQTT-3.3.1-6).
32 33 34 |
# File 'lib/zzq/persistence/interface.rb', line 32 def delete_retained(_topic) raise NotImplementedError end |
#load_retained ⇒ Object
Yields each persisted Message (retained). Called once at broker start to warm the in-memory RetainedStore.
18 19 20 |
# File 'lib/zzq/persistence/interface.rb', line 18 def load_retained raise NotImplementedError end |
#save_retained(_message) ⇒ Object
Persist a retained message under message.topic. Replaces any existing retained message for that topic.
25 26 27 |
# File 'lib/zzq/persistence/interface.rb', line 25 def save_retained() raise NotImplementedError end |