Class: PgEventstore::Config
- Inherits:
-
Object
- Object
- PgEventstore::Config
- Includes:
- Extensions::OptionsExtension
- Defined in:
- lib/pg_eventstore/config.rb
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.
-
#failed_subscription_notifier ⇒ #call?
Provide callable object that accepts Subscription instance and error.
-
#max_count ⇒ Integer
Number of events to return in one response when reading from a stream.
-
#middlewares ⇒ Hash{Symbol => <#serialize, #deserialize>}
A set of identified(by key) objects that respond to #serialize and #deserialize.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pg_uri ⇒ String
PostgreSQL connection URI docs 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.
Instance Method Summary collapse
-
#connection_options ⇒ Hash
Computes a value for usage in PgEventstore::Connection.
-
#initialize(name:, **options) ⇒ Config
constructor
A new instance of Config.
Methods included from Extensions::OptionsExtension
included, #options_hash, #readonly!, #readonly?
Constructor Details
#initialize(name:, **options) ⇒ Config
Returns a new instance of Config.
60 61 62 63 |
# File 'lib/pg_eventstore/config.rb', line 60 def initialize(name:, **) super @name = name end |
Instance Attribute Details
#connection_pool_size ⇒ Integer
Returns Max number of connections per ruby process.
28 |
# File 'lib/pg_eventstore/config.rb', line 28 option(:connection_pool_size) { 5 } |
#connection_pool_timeout ⇒ Integer
Returns Time in seconds to wait for the connection in pool to be released.
31 |
# File 'lib/pg_eventstore/config.rb', line 31 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.
25 |
# File 'lib/pg_eventstore/config.rb', line 25 option(:event_class_resolver) { EventClassResolver.new } |
#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.
54 |
# File 'lib/pg_eventstore/config.rb', line 54 option(:failed_subscription_notifier) |
#max_count ⇒ Integer
Returns Number of events to return in one response when reading from a stream.
17 |
# File 'lib/pg_eventstore/config.rb', line 17 option(:max_count) { 1000 } |
#middlewares ⇒ Hash{Symbol => <#serialize, #deserialize>}
Returns A set of identified(by key) objects that respond to #serialize and #deserialize.
21 |
# File 'lib/pg_eventstore/config.rb', line 21 option(:middlewares) { {} } |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/pg_eventstore/config.rb', line 7 def name @name end |
#pg_uri ⇒ String
Returns PostgreSQL connection URI docs www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-URIS.
12 13 14 |
# File 'lib/pg_eventstore/config.rb', line 12 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.
57 |
# File 'lib/pg_eventstore/config.rb', line 57 option(:subscription_graceful_shutdown_timeout) { 15 } |
#subscription_max_retries ⇒ Integer
Returns max number of retries of failed Subscription.
37 |
# File 'lib/pg_eventstore/config.rb', line 37 option(:subscription_max_retries) { 5 } |
#subscription_pull_interval ⇒ Float, Integer
Returns How often Subscription should pull new events, seconds.
34 |
# File 'lib/pg_eventstore/config.rb', line 34 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.
44 |
# File 'lib/pg_eventstore/config.rb', line 44 option(:subscription_restart_terminator) |
#subscription_retries_interval ⇒ Integer
Returns interval in seconds between retries of failed Subscription.
40 |
# File 'lib/pg_eventstore/config.rb', line 40 option(:subscription_retries_interval) { 1 } |
#subscriptions_set_max_retries ⇒ Integer
Returns max number of retries of failed SubscriptionsSet.
47 |
# File 'lib/pg_eventstore/config.rb', line 47 option(:subscriptions_set_max_retries) { 10 } |
#subscriptions_set_retries_interval ⇒ Integer
Returns interval in seconds between retries of failed SubscriptionsSet.
50 |
# File 'lib/pg_eventstore/config.rb', line 50 option(:subscriptions_set_retries_interval) { 1 } |
Instance Method Details
#connection_options ⇒ Hash
Computes a value for usage in PgEventstore::Connection
67 68 69 |
# File 'lib/pg_eventstore/config.rb', line 67 def { uri: pg_uri, pool_size: connection_pool_size, pool_timeout: connection_pool_timeout } end |