Class: PgEventstore::Config
- Inherits:
-
BasicConfig
- Object
- BasicConfig
- PgEventstore::Config
- Defined in:
- lib/pg_eventstore/config.rb,
sig/pg_eventstore/config.rbs
Defined Under Namespace
Modules: NodeRole
Instance Attribute Summary collapse
-
#connection_pool_size ⇒ Integer
Max number of connections per ruby process.
-
#connection_pool_timeout ⇒ Integer
Time in seconds to wait for the connection in pool to be released.
-
#event_class_resolver ⇒ #call
A callable object that must accept a string and return a class.
-
#events_subscription_position_update_interval ⇒ Float, Integer
Events subscription position update interval.
-
#eventstore_role ⇒ Symbol
The role of this node.
-
#failed_subscription_notifier ⇒ #call?
Provide callable object that accepts Subscription instance and error.
-
#max_count ⇒ Integer
@return — Number of events to return in one response when reading from a stream.
-
#max_events_to_replicate ⇒ Integer
Max number of events to replicate at a time.
-
#middlewares ⇒ Hash{Symbol => <#serialize, #deserialize>}
A set of identified(by key) objects that respond to #serialize and #deserialize.
-
#pg_uri ⇒ String
PostgreSQL connection URI docs https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-URIS.
-
#subscription_graceful_shutdown_timeout ⇒ Integer
The number of seconds to wait until force-shutdown the subscription during the stop process.
-
#subscription_max_retries ⇒ Integer
Max number of retries of failed Subscription.
-
#subscription_pull_interval ⇒ Float, Integer
How often Subscription should pull new events, seconds.
-
#subscription_restart_terminator ⇒ #call?
Provide callable object that accepts Subscription object to decide whether to prevent further Subscription restarts.
-
#subscription_retries_interval ⇒ Integer
Interval in seconds between retries of failed Subscription.
-
#subscriptions_set_max_retries ⇒ Integer
Max number of retries of failed SubscriptionsSet.
-
#subscriptions_set_retries_interval ⇒ Integer
Interval in seconds between retries of failed SubscriptionsSet.
Attributes inherited from BasicConfig
Instance Method Summary collapse
-
#connection_options ⇒ Hash
Computes a value for usage in PgEventstore::Connection.
-
#init_default_values ⇒ void
@param
options. - #options_hash ⇒ ::Hash[untyped, untyped]
-
#readonly! ⇒ Boolean
@param
opt_name. -
#readonly? ⇒ Boolean
@param
opt_name. -
#readonly_error ⇒ void
@param
opt_name.
Methods inherited from BasicConfig
Methods included from Extensions::OptionsExtension
Constructor Details
This class inherits a constructor from PgEventstore::BasicConfig
Instance Attribute Details
#connection_pool_size ⇒ Integer
Returns Max number of connections per ruby process.
45 |
# File 'lib/pg_eventstore/config.rb', line 45 option(:connection_pool_size) { 5 } |
#connection_pool_timeout ⇒ Integer
Returns Time in seconds to wait for the connection in pool to be released.
48 |
# File 'lib/pg_eventstore/config.rb', line 48 option(:connection_pool_timeout) { 5 } |
#event_class_resolver ⇒ #call
Returns A callable object that must accept a string and return a class. It is used when resolving event's class during event's deserialization process.
42 |
# File 'lib/pg_eventstore/config.rb', line 42 option(:event_class_resolver) { EventClassResolver.new } |
#events_subscription_position_update_interval ⇒ Float, Integer
Returns events subscription position update interval.
77 |
# File 'lib/pg_eventstore/config.rb', line 77 option(:events_subscription_position_update_interval) { 0.2 } |
#eventstore_role ⇒ Symbol
Returns the role of this node.
80 |
# File 'lib/pg_eventstore/config.rb', line 80 option(:eventstore_role) { NodeRole::STANDALONE } |
#failed_subscription_notifier ⇒ #call?
Returns provide callable object that accepts Subscription instance and error. It is useful when you want to be get notified when your Subscription fails and no longer can be restarted.
71 |
# File 'lib/pg_eventstore/config.rb', line 71 option(:failed_subscription_notifier) |
#max_count ⇒ Integer
@return — Number of events to return in one response when reading from a stream
34 |
# File 'lib/pg_eventstore/config.rb', line 34 option(:max_count) { 1000 } |
#max_events_to_replicate ⇒ Integer
Returns max number of events to replicate at a time.
83 |
# File 'lib/pg_eventstore/config.rb', line 83 option(:max_events_to_replicate) { 10_000 } |
#middlewares ⇒ Hash{Symbol => <#serialize, #deserialize>}
Returns A set of identified(by key) objects that respond to #serialize and #deserialize.
38 |
# File 'lib/pg_eventstore/config.rb', line 38 option(:middlewares) { {} } |
#pg_uri ⇒ String
Returns PostgreSQL connection URI docs https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-URIS.
29 30 31 |
# File 'lib/pg_eventstore/config.rb', line 29 option(:pg_uri) do ENV.fetch('PG_EVENTSTORE_URI', 'postgresql://postgres:postgres@localhost:5432/eventstore') end |
#subscription_graceful_shutdown_timeout ⇒ Integer
Returns the number of seconds to wait until force-shutdown the subscription during the stop process.
74 |
# File 'lib/pg_eventstore/config.rb', line 74 option(:subscription_graceful_shutdown_timeout) { 15 } |
#subscription_max_retries ⇒ Integer
Returns max number of retries of failed Subscription.
54 |
# File 'lib/pg_eventstore/config.rb', line 54 option(:subscription_max_retries) { 5 } |
#subscription_pull_interval ⇒ Float, Integer
Returns How often Subscription should pull new events, seconds.
51 |
# File 'lib/pg_eventstore/config.rb', line 51 option(:subscription_pull_interval) { 1.0 } |
#subscription_restart_terminator ⇒ #call?
Returns provide callable object that accepts Subscription object to decide whether to prevent further Subscription restarts.
61 |
# File 'lib/pg_eventstore/config.rb', line 61 option(:subscription_restart_terminator) |
#subscription_retries_interval ⇒ Integer
Returns interval in seconds between retries of failed Subscription.
57 |
# File 'lib/pg_eventstore/config.rb', line 57 option(:subscription_retries_interval) { 1 } |
#subscriptions_set_max_retries ⇒ Integer
Returns max number of retries of failed SubscriptionsSet.
64 |
# File 'lib/pg_eventstore/config.rb', line 64 option(:subscriptions_set_max_retries) { 10 } |
#subscriptions_set_retries_interval ⇒ Integer
Returns interval in seconds between retries of failed SubscriptionsSet.
67 |
# File 'lib/pg_eventstore/config.rb', line 67 option(:subscriptions_set_retries_interval) { 1 } |
Instance Method Details
#connection_options ⇒ Hash
Computes a value for usage in PgEventstore::Connection
87 88 89 90 |
# File 'lib/pg_eventstore/config.rb', line 87 def puts "DEPRECATED: Config##{__method__} will be removed in next major version with no replacement" { uri: pg_uri, pool_size: connection_pool_size, pool_timeout: connection_pool_timeout } end |
#init_default_values ⇒ void
This method returns an undefined value.
@param options
27 |
# File 'sig/pg_eventstore/config.rbs', line 27
def init_default_values: (::Hash[untyped, untyped] options) -> void
|
#options_hash ⇒ ::Hash[untyped, untyped]
15 |
# File 'sig/pg_eventstore/config.rbs', line 15
def options_hash: () -> ::Hash[untyped, untyped]
|
#readonly! ⇒ Boolean
@param opt_name
18 |
# File 'sig/pg_eventstore/config.rbs', line 18
def readonly!: (Symbol opt_name) -> bool
|
#readonly? ⇒ Boolean
@param opt_name
21 |
# File 'sig/pg_eventstore/config.rbs', line 21
def readonly?: (Symbol opt_name) -> bool
|
#readonly_error ⇒ void
This method returns an undefined value.
@param opt_name
24 |
# File 'sig/pg_eventstore/config.rbs', line 24
def readonly_error: (Symbol opt_name) -> void
|