Class: PgEventstore::Config

Inherits:
BasicConfig show all
Defined in:
lib/pg_eventstore/config.rb,
sig/pg_eventstore/config.rbs

Defined Under Namespace

Modules: NodeRole

Instance Attribute Summary collapse

Attributes inherited from BasicConfig

#name

Instance Method Summary collapse

Methods inherited from BasicConfig

#initialize

Methods included from Extensions::OptionsExtension

included, #initialize

Constructor Details

This class inherits a constructor from PgEventstore::BasicConfig

Instance Attribute Details

#connection_pool_sizeInteger

Returns Max number of connections per ruby process.

Parameters:

  • value (Integer)

Returns:

  • (Integer)

    Max number of connections per ruby process



45
# File 'lib/pg_eventstore/config.rb', line 45

option(:connection_pool_size) { 5 }

#connection_pool_timeoutInteger

Returns Time in seconds to wait for the connection in pool to be released.

Parameters:

  • value (Integer)

Returns:

  • (Integer)

    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.

Parameters:

Returns:

  • (#call)

    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_intervalFloat, Integer

Returns events subscription position update interval.

Parameters:

  • value (Integer, Float)

Returns:

  • (Float, Integer)

    events subscription position update interval



77
# File 'lib/pg_eventstore/config.rb', line 77

option(:events_subscription_position_update_interval) { 0.2 }

#eventstore_roleSymbol

Returns the role of this node.

Parameters:

  • value (Symbol)

Returns:

  • (Symbol)

    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.

Parameters:

Returns:

  • (#call, nil)

    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_countInteger

@return — Number of events to return in one response when reading from a stream

Returns:

  • (Integer)


34
# File 'lib/pg_eventstore/config.rb', line 34

option(:max_count) { 1000 }

#max_events_to_replicateInteger

Returns max number of events to replicate at a time.

Parameters:

  • value (Integer)

Returns:

  • (Integer)

    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 }

#middlewaresHash{Symbol => <#serialize, #deserialize>}

Returns A set of identified(by key) objects that respond to #serialize and #deserialize.

Parameters:

Returns:

  • (Hash{Symbol => <#serialize, #deserialize>})

    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_uriString

Parameters:

  • value (String)

Returns:



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_timeoutInteger

Returns the number of seconds to wait until force-shutdown the subscription during the stop process.

Parameters:

  • value (Integer, Float)

Returns:

  • (Integer)

    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_retriesInteger

Returns max number of retries of failed Subscription.

Parameters:

  • value (Integer)

Returns:

  • (Integer)

    max number of retries of failed Subscription



54
# File 'lib/pg_eventstore/config.rb', line 54

option(:subscription_max_retries) { 5 }

#subscription_pull_intervalFloat, Integer

Returns How often Subscription should pull new events, seconds.

Parameters:

  • value (Float, Integer)

Returns:

  • (Float, Integer)

    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.

Parameters:

Returns:

  • (#call, nil)

    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_intervalInteger

Returns interval in seconds between retries of failed Subscription.

Parameters:

  • value (Integer)

Returns:

  • (Integer)

    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_retriesInteger

Returns max number of retries of failed SubscriptionsSet.

Parameters:

  • value (Integer)

Returns:

  • (Integer)

    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_intervalInteger

Returns interval in seconds between retries of failed SubscriptionsSet.

Parameters:

  • value (Integer)

Returns:

  • (Integer)

    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_optionsHash

Computes a value for usage in PgEventstore::Connection

Returns:

  • (Hash)


87
88
89
90
# File 'lib/pg_eventstore/config.rb', line 87

def connection_options
  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_valuesvoid

This method returns an undefined value.

@param options

Parameters:

  • options (::Hash[untyped, untyped])


27
# File 'sig/pg_eventstore/config.rbs', line 27

def init_default_values: (::Hash[untyped, untyped] options) -> void

#options_hash::Hash[untyped, untyped]

Returns:

  • (::Hash[untyped, untyped])


15
# File 'sig/pg_eventstore/config.rbs', line 15

def options_hash: () -> ::Hash[untyped, untyped]

#readonly!Boolean

@param opt_name

Parameters:

  • opt_name (Symbol)

Returns:

  • (Boolean)


18
# File 'sig/pg_eventstore/config.rbs', line 18

def readonly!: (Symbol opt_name) -> bool

#readonly?Boolean

@param opt_name

Parameters:

  • opt_name (Symbol)

Returns:

  • (Boolean)


21
# File 'sig/pg_eventstore/config.rbs', line 21

def readonly?: (Symbol opt_name) -> bool

#readonly_errorvoid

This method returns an undefined value.

@param opt_name

Parameters:

  • opt_name (Symbol)


24
# File 'sig/pg_eventstore/config.rbs', line 24

def readonly_error: (Symbol opt_name) -> void