Class: Prosody::Context
- Inherits:
-
Object
- Object
- Prosody::Context
- Includes:
- State::Vending
- Defined in:
- lib/prosody/state.rb,
lib/prosody/native_stubs.rb,
sig/state.rbs,
sig/prosody.rbs
Overview
Represents the context of a Kafka message. Provides metadata and control capabilities for message processing.
Instance Method Summary collapse
-
#clear_and_schedule(time) ⇒ void
Clears all scheduled timers and schedules a new one at the specified time.
-
#clear_scheduled ⇒ void
Clears all scheduled timers.
-
#deque_state(name) ⇒ NativeJsonDequeState
Vends the native deque JSON state handle for the named collection.
-
#initialize ⇒ Context
constructor
A new instance of Context.
-
#map_state(name) ⇒ NativeJsonMapState
Vends the native ordered-map JSON state handle for the named collection.
-
#message_deque_state(name) ⇒ NativeMessageDequeState
Vends the native deque message state handle for the named collection.
-
#message_map_state(name) ⇒ NativeMessageMapState
Vends the native ordered-map message state handle for the named collection.
-
#message_value_state(name) ⇒ NativeMessageValueState
Vends the native single-value message state handle for the named collection.
-
#on_cancel ⇒ void
Blocks until cancellation is signaled.
-
#schedule(time) ⇒ void
Schedules a timer to fire at the specified time.
-
#scheduled ⇒ Array<Time>
Returns all currently scheduled timer times.
-
#should_cancel? ⇒ bool
Checks if cancellation has been requested.
-
#unschedule(time) ⇒ void
Unschedules a timer that was scheduled for the specified time.
-
#value_state(name) ⇒ NativeJsonValueState
Vends the native single-value JSON state handle for the named collection.
Methods included from State::Vending
Constructor Details
#initialize ⇒ Context
Returns a new instance of Context.
37 38 39 |
# File 'lib/prosody/native_stubs.rb', line 37 def initialize raise NotImplementedError, "This class is implemented natively in Rust" end |
Instance Method Details
#clear_and_schedule(time) ⇒ void
This method returns an undefined value.
Clears all scheduled timers and schedules a new one at the specified time.
121 122 123 |
# File 'lib/prosody/native_stubs.rb', line 121 def clear_and_schedule(time) raise NotImplementedError, "This method is implemented natively in Rust" end |
#clear_scheduled ⇒ void
This method returns an undefined value.
Clears all scheduled timers.
159 160 161 |
# File 'lib/prosody/native_stubs.rb', line 159 def clear_scheduled raise NotImplementedError, "This method is implemented natively in Rust" end |
#deque_state(name) ⇒ NativeJsonDequeState
Vends the native deque JSON state handle for the named collection.
Internal routing target for State::Vending#state; prefer
context.state(definition).
218 219 220 |
# File 'lib/prosody/native_stubs.rb', line 218 def deque_state(name) raise NotImplementedError, "This method is implemented natively in Rust" end |
#map_state(name) ⇒ NativeJsonMapState
Vends the native ordered-map JSON state handle for the named collection.
Internal routing target for State::Vending#state; prefer
context.state(definition).
205 206 207 |
# File 'lib/prosody/native_stubs.rb', line 205 def map_state(name) raise NotImplementedError, "This method is implemented natively in Rust" end |
#message_deque_state(name) ⇒ NativeMessageDequeState
Vends the native deque message state handle for the named collection.
Internal routing target for State::Vending#state; prefer
context.state(definition).
259 260 261 |
# File 'lib/prosody/native_stubs.rb', line 259 def (name) raise NotImplementedError, "This method is implemented natively in Rust" end |
#message_map_state(name) ⇒ NativeMessageMapState
Vends the native ordered-map message state handle for the named collection.
Internal routing target for State::Vending#state; prefer
context.state(definition).
246 247 248 |
# File 'lib/prosody/native_stubs.rb', line 246 def (name) raise NotImplementedError, "This method is implemented natively in Rust" end |
#message_value_state(name) ⇒ NativeMessageValueState
Vends the native single-value message state handle for the named collection.
Internal routing target for State::Vending#state; prefer
context.state(definition).
232 233 234 |
# File 'lib/prosody/native_stubs.rb', line 232 def (name) raise NotImplementedError, "This method is implemented natively in Rust" end |
#on_cancel ⇒ void
This method returns an undefined value.
Blocks until cancellation is signaled. Cancellation includes both message-level cancellation (e.g., timeout) and partition shutdown.
78 79 80 |
# File 'lib/prosody/native_stubs.rb', line 78 def on_cancel raise NotImplementedError, "This method is implemented natively in Rust" end |
#schedule(time) ⇒ void
This method returns an undefined value.
Schedules a timer to fire at the specified time.
102 103 104 |
# File 'lib/prosody/native_stubs.rb', line 102 def schedule(time) raise NotImplementedError, "This method is implemented natively in Rust" end |
#scheduled ⇒ Array<Time>
Returns all currently scheduled timer times.
179 180 181 |
# File 'lib/prosody/native_stubs.rb', line 179 def scheduled raise NotImplementedError, "This method is implemented natively in Rust" end |
#should_cancel? ⇒ bool
Checks if cancellation has been requested. Cancellation includes both message-level cancellation (e.g., timeout) and partition shutdown.
59 60 61 |
# File 'lib/prosody/native_stubs.rb', line 59 def should_cancel? raise NotImplementedError, "This method is implemented natively in Rust" end |
#unschedule(time) ⇒ void
This method returns an undefined value.
Unschedules a timer that was scheduled for the specified time.
143 144 145 |
# File 'lib/prosody/native_stubs.rb', line 143 def unschedule(time) raise NotImplementedError, "This method is implemented natively in Rust" end |
#value_state(name) ⇒ NativeJsonValueState
Vends the native single-value JSON state handle for the named collection.
Internal routing target for State::Vending#state; prefer
context.state(definition).
192 193 194 |
# File 'lib/prosody/native_stubs.rb', line 192 def value_state(name) raise NotImplementedError, "This method is implemented natively in Rust" end |