Module: Prosody
- Defined in:
- lib/prosody.rb,
lib/prosody/state.rb,
lib/prosody/sentry.rb,
lib/prosody/handler.rb,
lib/prosody/request.rb,
lib/prosody/version.rb,
lib/prosody/processor.rb,
lib/prosody/native_stubs.rb,
lib/prosody/configuration.rb,
sig/state.rbs,
sig/sentry.rbs,
sig/handler.rbs,
sig/prosody.rbs,
sig/request.rbs,
sig/version.rbs,
sig/processor.rbs,
sig/configuration.rbs
Defined Under Namespace
Modules: Commands, ErrorClassification, NativeDequeOperations, NativeMapOperations, NativeScanOperations, NativeValueOperations, SentryIntegration, State, _DequeDefinition, _MapDefinition, _MessageDequeDefinition, _MessageMapDefinition, _MessageValueDefinition, _NativeDequeHandle, _NativeMapHandle, _NativeScan, _NativeValueHandle, _ToA, _ToInt, _ToS, _ValueDefinition Classes: AdminClient, AsyncTaskProcessor, CancellationToken, Client, Configuration, Context, DequeState, DynamicResult, Error, EventHandler, EventHandlerError, ExciseMessage, Failure, FormatMismatch, HandlerError, MalformedResponse, MapState, Message, NativeJsonDequeScan, NativeJsonDequeState, NativeJsonMapScan, NativeJsonMapState, NativeJsonValueState, NativeMapKeyScan, NativeMessageDequeScan, NativeMessageDequeState, NativeMessageMapScan, NativeMessageMapState, NativeMessageValueState, NativePublishedDeque, NativePublishedMap, NativePublishedValue, NullValueError, PermanentError, PermanentStateError, PublishedDeque, PublishedMap, PublishedValue, StateDefinition, Success, Timeout, Timer, TransientError, TransientStateError, ValueState
Constant Summary collapse
- VERSION =
Current version of the Prosody library.
This version number follows semantic versioning and is used by the gem system to identify the library version.
"0.5.0"
Class Method Summary collapse
-
.deque(name, ttl: nil, capacity: nil, read_uncommitted: nil, published: nil, read_cache: nil) ⇒ StateDefinition
Defines a deque JSON collection.
-
.flush_telemetry ⇒ void
Exports buffered telemetry without shutting down the process-global pipeline.
-
.logger ⇒ Logger
Returns the module-level logger, creating a default if not yet set.
-
.logger=(logger) ⇒ Logger?
Sets the module-level logger.
-
.map(name, ttl: nil, keyset_limit: nil, read_uncommitted: nil, published: nil, read_cache: nil) ⇒ StateDefinition
Defines a
String-keyed ordered map JSON collection. -
.message_deque(name, ttl: nil, capacity: nil, read_uncommitted: nil) ⇒ StateDefinition
Defines a deque Kafka-message collection.
-
.message_map(name, ttl: nil, keyset_limit: nil, read_uncommitted: nil) ⇒ StateDefinition
Defines a
String-keyed ordered map Kafka-message collection. -
.message_value(name, ttl: nil, read_uncommitted: nil) ⇒ StateDefinition
Defines a single-value Kafka-message collection (items are full messages).
-
.shutdown_telemetry ⇒ void
Exports buffered telemetry and shuts down the process-global pipeline.
-
.value(name, ttl: nil, read_uncommitted: nil, published: nil, read_cache: nil) ⇒ void
--- definition constructors -------------------------------------------- The
message_*siblings return the same structural definition interfaces as their JSON counterparts (the runtime object is one StateDefinition); the[P]type parameter is annotation-only, naming the message payload type.
Class Method Details
.deque(name, ttl: nil, capacity: nil, read_uncommitted: nil, published: nil, read_cache: nil) ⇒ StateDefinition
Defines a deque JSON collection.
113 114 115 116 117 118 |
# File 'lib/prosody/state.rb', line 113 def self.deque(name, ttl: nil, capacity: nil, read_uncommitted: nil, published: nil, read_cache: nil) StateDefinition.new(name: name.to_s, kind: "deque", payload: "json", ttl_seconds: ttl, read_uncommitted: read_uncommitted, published: published, read_cache: read_cache, keyset_limit: nil, capacity: capacity, access: DEQUE_ACCESS) end |
.flush_telemetry ⇒ void
This method returns an undefined value.
Exports buffered telemetry without shutting down the process-global pipeline.
16 |
# File 'sig/prosody.rbs', line 16
def self.flush_telemetry: () -> void
|
.logger ⇒ Logger
Returns the module-level logger, creating a default if not yet set. The default writes to $stdout at INFO level.
10 11 12 |
# File 'sig/prosody.rbs', line 10 def self.logger @logger ||= Logger.new($stdout).tap { |l| l.level = Logger::INFO } end |
.logger=(logger) ⇒ Logger?
Sets the module-level logger. Pass nil to reset to the default.
13 14 15 |
# File 'sig/prosody.rbs', line 13 def self.logger=(logger) @logger = logger end |
.map(name, ttl: nil, keyset_limit: nil, read_uncommitted: nil, published: nil, read_cache: nil) ⇒ StateDefinition
Defines a String-keyed ordered map JSON collection.
97 98 99 100 101 102 |
# File 'lib/prosody/state.rb', line 97 def self.map(name, ttl: nil, keyset_limit: nil, read_uncommitted: nil, published: nil, read_cache: nil) StateDefinition.new(name: name.to_s, kind: "map", payload: "json", ttl_seconds: ttl, read_uncommitted: read_uncommitted, published: published, read_cache: read_cache, keyset_limit: keyset_limit, capacity: nil, access: MAP_ACCESS) end |
.message_deque(name, ttl: nil, capacity: nil, read_uncommitted: nil) ⇒ StateDefinition
Defines a deque Kafka-message collection.
156 157 158 159 160 161 |
# File 'lib/prosody/state.rb', line 156 def self.(name, ttl: nil, capacity: nil, read_uncommitted: nil) StateDefinition.new(name: name.to_s, kind: "deque", payload: "message", ttl_seconds: ttl, read_uncommitted: read_uncommitted, published: nil, read_cache: nil, keyset_limit: nil, capacity: capacity, access: MESSAGE_DEQUE_ACCESS) end |
.message_map(name, ttl: nil, keyset_limit: nil, read_uncommitted: nil) ⇒ StateDefinition
Defines a String-keyed ordered map Kafka-message collection.
140 141 142 143 144 145 |
# File 'lib/prosody/state.rb', line 140 def self.(name, ttl: nil, keyset_limit: nil, read_uncommitted: nil) StateDefinition.new(name: name.to_s, kind: "map", payload: "message", ttl_seconds: ttl, read_uncommitted: read_uncommitted, published: nil, read_cache: nil, keyset_limit: keyset_limit, capacity: nil, access: MESSAGE_MAP_ACCESS) end |
.message_value(name, ttl: nil, read_uncommitted: nil) ⇒ StateDefinition
Defines a single-value Kafka-message collection (items are full messages).
126 127 128 129 130 131 |
# File 'lib/prosody/state.rb', line 126 def self.(name, ttl: nil, read_uncommitted: nil) StateDefinition.new(name: name.to_s, kind: "value", payload: "message", ttl_seconds: ttl, read_uncommitted: read_uncommitted, published: nil, read_cache: nil, keyset_limit: nil, capacity: nil, access: MESSAGE_VALUE_ACCESS) end |
.shutdown_telemetry ⇒ void
This method returns an undefined value.
Exports buffered telemetry and shuts down the process-global pipeline.
19 |
# File 'sig/prosody.rbs', line 19
def self.shutdown_telemetry: () -> void
|
.value(name, ttl: nil, read_uncommitted: nil, published: nil, read_cache: nil) ⇒ void
This method returns an undefined value.
--- definition constructors --------------------------------------------
The message_* siblings return the same structural definition interfaces as
their JSON counterparts (the runtime object is one StateDefinition); the
[P] type parameter is annotation-only, naming the message payload type.
83 84 85 86 87 88 |
# File 'lib/prosody/state.rb', line 83 def self.value(name, ttl: nil, read_uncommitted: nil, published: nil, read_cache: nil) StateDefinition.new(name: name.to_s, kind: "value", payload: "json", ttl_seconds: ttl, read_uncommitted: read_uncommitted, published: published, read_cache: read_cache, keyset_limit: nil, capacity: nil, access: VALUE_ACCESS) end |