Class: Prosody::Context

Inherits:
Object
  • Object
show all
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

Methods included from State::Vending

#state

Constructor Details

#initializeContext

Returns a new instance of Context.

Parameters:

  • (Object)

Raises:

  • (NotImplementedError)


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.

Parameters:

  • time (Time)

    When the new timer should fire



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_scheduledvoid

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).

Parameters:

  • name (String)

    the registered collection name

Returns:

Raises:



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).

Parameters:

  • name (String)

    the registered collection name

Returns:

Raises:



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).

Parameters:

  • name (String)

    the registered collection name

Returns:

Raises:



259
260
261
# File 'lib/prosody/native_stubs.rb', line 259

def message_deque_state(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).

Parameters:

  • name (String)

    the registered collection name

Returns:

Raises:



246
247
248
# File 'lib/prosody/native_stubs.rb', line 246

def message_map_state(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).

Parameters:

  • name (String)

    the registered collection name

Returns:

Raises:



232
233
234
# File 'lib/prosody/native_stubs.rb', line 232

def message_value_state(name)
  raise NotImplementedError, "This method is implemented natively in Rust"
end

#on_cancelvoid

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.

Parameters:

  • time (Time)

    When the timer should fire



102
103
104
# File 'lib/prosody/native_stubs.rb', line 102

def schedule(time)
  raise NotImplementedError, "This method is implemented natively in Rust"
end

#scheduledArray<Time>

Returns all currently scheduled timer times.

Returns:

  • (Array<Time>)

    Array of 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.

Returns:

  • (bool)

    true if cancellation has been requested, false otherwise



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.

Parameters:

  • time (Time)

    The time for which to unschedule the timer



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).

Parameters:

  • name (String)

    the registered collection name

Returns:

Raises:



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