pg_eventstore 1.13.4 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +11 -2
- data/CHANGELOG.md +195 -16
- data/README.md +33 -10
- data/db/migrations/10_setup_pg_cron.rb +1 -0
- data/db/migrations/11_add_events_link_global_position.sql +1 -0
- data/db/migrations/12_migrate_legacy_links.rb +83 -0
- data/db/migrations/13_remove_events_link_id.sql +6 -0
- data/db/migrations/14_remove_ids_events_id_index.sql +1 -0
- data/db/migrations/15_create_streams_global_index.sql +17 -0
- data/db/migrations/16_populate_streams_global_index.rb +150 -0
- data/db/migrations/17_create_events_global_index.sql +62 -0
- data/db/migrations/18_populate_events_global_index.rb +124 -0
- data/db/migrations/19_populate_events_global_index_p2.rb +25 -0
- data/db/migrations/20_migrate_subscriptions_current_position.sql +19 -0
- data/db/migrations/21_create_partitions_stats.sql +2 -0
- data/db/migrations/22_drop_streams_sql_view.sql +2 -0
- data/db/migrations/23_adjust_partitions_indexes.sql +5 -0
- data/db/migrations/24_drop_legacy_events_indexes.sql +3 -0
- data/db/migrations/25_add_parent_partitions_info_to_partitions.sql +16 -0
- data/db/migrations/26_change_events_stream_revision_type.rb +35 -0
- data/db/migrations/27_drop_events_horizon.sql +3 -0
- data/db/migrations/28_create_maintenance_tasks.sql +8 -0
- data/db/migrations/29_create_event_markers.sql +35 -0
- data/db/migrations/30_improve_partitions_search_in_admin_ui.rb +24 -0
- data/db/migrations/31_drop_events_id_default_value.sql +1 -0
- data/db/migrations/32_create_parittions_triggers.sql +101 -0
- data/db/migrations/9_create_events_horizon.sql +21 -0
- data/docs/AGENTS.fragment.md +696 -0
- data/docs/admin_ui.md +3 -1
- data/docs/appending_events.md +110 -49
- data/docs/configuration.md +69 -36
- data/docs/event_tracing.md +55 -0
- data/docs/events_and_streams.md +54 -30
- data/docs/how_it_works.md +57 -16
- data/docs/linking_events.md +2 -1
- data/docs/maintenance.md +14 -5
- data/docs/multiple_commands.md +30 -6
- data/docs/reading_events.md +208 -43
- data/docs/reading_streams.md +50 -0
- data/docs/replication.md +99 -0
- data/docs/subscriptions.md +165 -35
- data/docs/writing_middleware.md +25 -8
- data/ext/pg_eventstore_ext/extconf.rb +5 -0
- data/ext/pg_eventstore_ext/pg_eventstore_ext.c +74 -0
- data/lib/pg_eventstore/async_runner.rb +63 -0
- data/lib/pg_eventstore/basic_config.rb +15 -0
- data/lib/pg_eventstore/callbacks.rb +7 -5
- data/lib/pg_eventstore/chunks/chunk.rb +31 -0
- data/lib/pg_eventstore/chunks/read_api_events_index_chunk.rb +83 -0
- data/lib/pg_eventstore/chunks/replica_events_index_chunk.rb +35 -0
- data/lib/pg_eventstore/chunks/repository.rb +73 -0
- data/lib/pg_eventstore/chunks/subscription_checkpoint_chunk.rb +48 -0
- data/lib/pg_eventstore/chunks/subscription_events_index_chunk.rb +99 -0
- data/lib/pg_eventstore/chunks.rb +14 -0
- data/lib/pg_eventstore/cli/try_to_delete_subscriptions_set.rb +2 -2
- data/lib/pg_eventstore/client.rb +167 -52
- data/lib/pg_eventstore/commands/append.rb +62 -43
- data/lib/pg_eventstore/commands/delete_event.rb +7 -8
- data/lib/pg_eventstore/commands/delete_stream.rb +3 -3
- data/lib/pg_eventstore/commands/event_modifiers/prepare_link_event.rb +11 -6
- data/lib/pg_eventstore/commands/event_modifiers/prepare_regular_event.rb +12 -7
- data/lib/pg_eventstore/commands/link_to.rb +9 -9
- data/lib/pg_eventstore/commands/multiple.rb +2 -2
- data/lib/pg_eventstore/commands/read.rb +23 -5
- data/lib/pg_eventstore/commands/read_grouped.rb +46 -0
- data/lib/pg_eventstore/commands/read_streams.rb +18 -0
- data/lib/pg_eventstore/commands/read_streams_paginated.rb +56 -0
- data/lib/pg_eventstore/commands/regular_stream_read_paginated.rb +4 -4
- data/lib/pg_eventstore/commands/revision_check/current_revision.rb +51 -0
- data/lib/pg_eventstore/commands/revision_check/event_type_revisions_comparison.rb +46 -0
- data/lib/pg_eventstore/commands/revision_check/expected_revision.rb +135 -0
- data/lib/pg_eventstore/commands/revision_check/stream_revision_check.rb +98 -0
- data/lib/pg_eventstore/commands/revision_check/stream_revision_comparison.rb +36 -0
- data/lib/pg_eventstore/commands/stream_revision.rb +14 -0
- data/lib/pg_eventstore/commands/system_stream_read_paginated.rb +4 -4
- data/lib/pg_eventstore/commands.rb +4 -2
- data/lib/pg_eventstore/config.rb +30 -9
- data/lib/pg_eventstore/connection.rb +22 -37
- data/lib/pg_eventstore/errors.rb +137 -11
- data/lib/pg_eventstore/event.rb +39 -7
- data/lib/pg_eventstore/event_deserializer.rb +5 -4
- data/lib/pg_eventstore/event_global_index.rb +118 -0
- data/lib/pg_eventstore/event_marker.rb +16 -0
- data/lib/pg_eventstore/event_marker_index.rb +25 -0
- data/lib/pg_eventstore/event_serializer.rb +6 -0
- data/lib/pg_eventstore/extensions/acts_as_configurable.rb +88 -0
- data/lib/pg_eventstore/extensions/options_defaults.rb +25 -0
- data/lib/pg_eventstore/extensions/options_extension.rb +42 -13
- data/lib/pg_eventstore/feature_marker.rb +18 -0
- data/lib/pg_eventstore/maintenance.rb +11 -6
- data/lib/pg_eventstore/middleware/event_tracing.rb +53 -0
- data/lib/pg_eventstore/partition.rb +6 -0
- data/lib/pg_eventstore/pg_connection.rb +70 -14
- data/lib/pg_eventstore/queries/event_marker_queries.rb +74 -0
- data/lib/pg_eventstore/queries/event_queries.rb +9 -95
- data/lib/pg_eventstore/queries/events_global_index_queries.rb +131 -0
- data/lib/pg_eventstore/queries/index_filtering_queries.rb +179 -0
- data/lib/pg_eventstore/queries/links_resolver.rb +10 -7
- data/lib/pg_eventstore/queries/maintenance_queries.rb +159 -42
- data/lib/pg_eventstore/queries/partition_queries.rb +46 -104
- data/lib/pg_eventstore/queries/replica_queries.rb +110 -0
- data/lib/pg_eventstore/queries/streams_global_index_queries.rb +163 -0
- data/lib/pg_eventstore/queries/transaction_queries.rb +58 -10
- data/lib/pg_eventstore/queries.rb +29 -1
- data/lib/pg_eventstore/query_builders/basic_filtering.rb +38 -5
- data/lib/pg_eventstore/query_builders/event_markers_filtering.rb +47 -0
- data/lib/pg_eventstore/query_builders/event_markers_index_filtering.rb +275 -0
- data/lib/pg_eventstore/query_builders/event_subscription_positions_filtering.rb +37 -0
- data/lib/pg_eventstore/query_builders/events_filtering.rb +15 -164
- data/lib/pg_eventstore/query_builders/events_global_index_filtering.rb +227 -0
- data/lib/pg_eventstore/query_builders/filters/collection.rb +324 -0
- data/lib/pg_eventstore/query_builders/filters/event_type_filter.rb +37 -0
- data/lib/pg_eventstore/query_builders/filters/filter_row.rb +54 -0
- data/lib/pg_eventstore/query_builders/filters/marker_filter.rb +20 -0
- data/lib/pg_eventstore/query_builders/filters/marker_filter_row.rb +49 -0
- data/lib/pg_eventstore/query_builders/filters/stream_filter.rb +48 -0
- data/lib/pg_eventstore/query_builders/index_based_events_filtering.rb +260 -0
- data/lib/pg_eventstore/query_builders/partitions_filtering.rb +175 -51
- data/lib/pg_eventstore/query_builders/read_cursor/stream_cursor.rb +122 -0
- data/lib/pg_eventstore/query_builders/streams_global_index_filtering.rb +83 -0
- data/lib/pg_eventstore/query_builders/subscription_events_filtering.rb +79 -0
- data/lib/pg_eventstore/query_strategy/async.rb +64 -0
- data/lib/pg_eventstore/query_strategy/foreground.rb +25 -0
- data/lib/pg_eventstore/query_strategy.rb +19 -0
- data/lib/pg_eventstore/raw_event.rb +46 -0
- data/lib/pg_eventstore/rspec/test_helpers.rb +21 -8
- data/lib/pg_eventstore/sql_builder.rb +87 -8
- data/lib/pg_eventstore/stream.rb +14 -17
- data/lib/pg_eventstore/stream_global_index.rb +28 -0
- data/lib/pg_eventstore/subscriptions/basic_runner.rb +4 -4
- data/lib/pg_eventstore/subscriptions/callback_handlers/events_processor_handlers.rb +5 -17
- data/lib/pg_eventstore/subscriptions/callback_handlers/events_subscription_position_worker_handlers.rb +36 -0
- data/lib/pg_eventstore/subscriptions/callback_handlers/subscription_feeder_handlers.rb +13 -1
- data/lib/pg_eventstore/subscriptions/callback_handlers/subscription_runner_handlers.rb +19 -14
- data/lib/pg_eventstore/subscriptions/events_processor.rb +21 -19
- data/lib/pg_eventstore/subscriptions/events_processor_consumer/multiple.rb +63 -0
- data/lib/pg_eventstore/subscriptions/events_processor_consumer/replica.rb +68 -0
- data/lib/pg_eventstore/subscriptions/events_processor_consumer/single.rb +62 -0
- data/lib/pg_eventstore/subscriptions/events_processor_consumer.rb +44 -0
- data/lib/pg_eventstore/subscriptions/events_subscription_position_worker.rb +68 -0
- data/lib/pg_eventstore/subscriptions/queries/event_subscription_position_queries.rb +177 -0
- data/lib/pg_eventstore/subscriptions/queries/subscription_command_queries.rb +5 -5
- data/lib/pg_eventstore/subscriptions/queries/subscription_queries.rb +80 -56
- data/lib/pg_eventstore/subscriptions/queries/subscriptions_set_command_queries.rb +2 -2
- data/lib/pg_eventstore/subscriptions/queries/subscriptions_set_queries.rb +1 -1
- data/lib/pg_eventstore/subscriptions/replica_subscription_handler.rb +140 -0
- data/lib/pg_eventstore/subscriptions/replica_subscription_runner.rb +9 -0
- data/lib/pg_eventstore/subscriptions/subscription.rb +9 -7
- data/lib/pg_eventstore/subscriptions/subscription_feed_strategies/collection.rb +36 -0
- data/lib/pg_eventstore/subscriptions/subscription_feed_strategies/index_read_strategy.rb +82 -0
- data/lib/pg_eventstore/subscriptions/subscription_feed_strategies/replication_strategy.rb +75 -0
- data/lib/pg_eventstore/subscriptions/subscription_feed_strategy.rb +31 -0
- data/lib/pg_eventstore/subscriptions/subscription_feeder.rb +26 -2
- data/lib/pg_eventstore/subscriptions/subscription_handler_performance.rb +5 -5
- data/lib/pg_eventstore/subscriptions/subscription_runner.rb +20 -22
- data/lib/pg_eventstore/subscriptions/subscription_runner_commands/reset_position.rb +1 -1
- data/lib/pg_eventstore/subscriptions/subscription_runners_feeder.rb +10 -11
- data/lib/pg_eventstore/subscriptions/subscriptions_lifecycle.rb +0 -12
- data/lib/pg_eventstore/subscriptions/subscriptions_manager.rb +84 -29
- data/lib/pg_eventstore/{subscriptions/synchronized_array.rb → synchronized_array.rb} +15 -0
- data/lib/pg_eventstore/tasks/setup.rake +32 -33
- data/lib/pg_eventstore/utils.rb +39 -0
- data/lib/pg_eventstore/version.rb +1 -1
- data/lib/pg_eventstore/web/application.rb +104 -20
- data/lib/pg_eventstore/web/paginator/base_collection.rb +5 -1
- data/lib/pg_eventstore/web/paginator/event_types_collection.rb +14 -4
- data/lib/pg_eventstore/web/paginator/events_collection.rb +29 -33
- data/lib/pg_eventstore/web/paginator/helpers.rb +19 -12
- data/lib/pg_eventstore/web/paginator/markers_collection.rb +48 -0
- data/lib/pg_eventstore/web/paginator/stream_contexts_collection.rb +13 -2
- data/lib/pg_eventstore/web/paginator/stream_ids_collection.rb +21 -11
- data/lib/pg_eventstore/web/paginator/stream_names_collection.rb +18 -4
- data/lib/pg_eventstore/web/paginator/streams_collection.rb +95 -0
- data/lib/pg_eventstore/web/public/javascripts/pg_eventstore.js +49 -22
- data/lib/pg_eventstore/web/subscriptions/helpers.rb +2 -2
- data/lib/pg_eventstore/web/subscriptions/set_collection.rb +1 -1
- data/lib/pg_eventstore/web/subscriptions/subscriptions.rb +1 -1
- data/lib/pg_eventstore/web/subscriptions/with_state/set_collection.rb +1 -1
- data/lib/pg_eventstore/web/subscriptions/with_state/subscriptions.rb +1 -1
- data/lib/pg_eventstore/web/views/home/dashboard.erb +11 -9
- data/lib/pg_eventstore/web/views/home/partials/event_filter.erb +18 -5
- data/lib/pg_eventstore/web/views/home/partials/events.erb +38 -1
- data/lib/pg_eventstore/web/views/home/partials/markers_filter.erb +18 -0
- data/lib/pg_eventstore/web/views/layouts/application.erb +6 -0
- data/lib/pg_eventstore/web/views/streams/index.erb +110 -0
- data/lib/pg_eventstore/web/views/streams/partials/streams.erb +11 -0
- data/lib/pg_eventstore/web/views/subscriptions/index.erb +4 -1
- data/lib/pg_eventstore/web.rb +2 -0
- data/lib/pg_eventstore.rb +26 -63
- data/pg_eventstore.gemspec +6 -4
- data/sig/interfaces/_raw_events_handler.rbs +3 -0
- data/sig/interfaces/subscription_handler.rbs +1 -1
- data/sig/pg/result.rbs +9 -0
- data/sig/pg_eventstore/async_runner.rbs +13 -0
- data/sig/pg_eventstore/basic_config.rbs +9 -0
- data/sig/pg_eventstore/chunks/chunk.rbs +13 -0
- data/sig/pg_eventstore/chunks/read_api_events_index_chunk.rbs +30 -0
- data/sig/pg_eventstore/chunks/replica_events_index_chunk.rbs +11 -0
- data/sig/pg_eventstore/chunks/repository.rbs +22 -0
- data/sig/pg_eventstore/chunks/subscription_checkpoint_chunk.rbs +18 -0
- data/sig/pg_eventstore/chunks/subscription_events_index_chunk.rbs +37 -0
- data/sig/pg_eventstore/client.rbs +41 -43
- data/sig/pg_eventstore/commands/append.rbs +11 -25
- data/sig/pg_eventstore/commands/event_modifiers/prepare_link_event.rbs +9 -12
- data/sig/pg_eventstore/commands/event_modifiers/prepare_regular_event.rbs +5 -4
- data/sig/pg_eventstore/commands/link_to.rbs +6 -11
- data/sig/pg_eventstore/commands/multiple.rbs +1 -1
- data/sig/pg_eventstore/commands/read.rbs +2 -5
- data/sig/pg_eventstore/commands/read_grouped.rbs +7 -0
- data/sig/pg_eventstore/commands/read_streams.rbs +7 -0
- data/sig/pg_eventstore/commands/read_streams_paginated.rbs +16 -0
- data/sig/pg_eventstore/commands/regular_stream_read_paginated.rbs +9 -17
- data/sig/pg_eventstore/commands/revision_check/current_revision.rbs +25 -0
- data/sig/pg_eventstore/commands/revision_check/event_type_revisions_comparison.rbs +14 -0
- data/sig/pg_eventstore/commands/revision_check/expected_revision.rbs +67 -0
- data/sig/pg_eventstore/commands/revision_check/stream_revision_check.rbs +20 -0
- data/sig/pg_eventstore/commands/revision_check/stream_revision_comparison.rbs +9 -0
- data/sig/pg_eventstore/commands/stream_revision.rbs +7 -0
- data/sig/pg_eventstore/commands/system_stream_read_paginated.rbs +9 -14
- data/sig/pg_eventstore/config.rbs +15 -6
- data/sig/pg_eventstore/connection.rbs +11 -18
- data/sig/pg_eventstore/errors.rbs +64 -34
- data/sig/pg_eventstore/event.rbs +20 -6
- data/sig/pg_eventstore/event_deserializer.rbs +5 -10
- data/sig/pg_eventstore/event_global_index.rbs +60 -0
- data/sig/pg_eventstore/event_marker.rbs +9 -0
- data/sig/pg_eventstore/event_marker_index.rbs +12 -0
- data/sig/pg_eventstore/extensions/acts_as_configurable.rbs +29 -0
- data/sig/pg_eventstore/extensions/options_defaults.rbs +7 -0
- data/sig/pg_eventstore/extensions/options_extension.rbs +9 -1
- data/sig/pg_eventstore/feature_marker.rbs +10 -0
- data/sig/pg_eventstore/maintenance.rbs +12 -8
- data/sig/pg_eventstore/middleware/event_trace.rbs +14 -0
- data/sig/pg_eventstore/partition.rbs +2 -4
- data/sig/pg_eventstore/pg_connection.rbs +8 -0
- data/sig/pg_eventstore/queries/event_marker_queries.rbs +21 -0
- data/sig/pg_eventstore/queries/event_queries.rbs +6 -38
- data/sig/pg_eventstore/queries/events_global_index_queries.rbs +37 -0
- data/sig/pg_eventstore/queries/index_filtering_queries.rbs +50 -0
- data/sig/pg_eventstore/queries/links_resolver.rbs +7 -11
- data/sig/pg_eventstore/queries/maintenance_queries.rbs +12 -9
- data/sig/pg_eventstore/queries/partition_queries.rbs +32 -67
- data/sig/pg_eventstore/queries/replica_queries.rbs +31 -0
- data/sig/pg_eventstore/queries/streams_global_index_queries.rbs +39 -0
- data/sig/pg_eventstore/queries/transaction_queries.rbs +4 -2
- data/sig/pg_eventstore/queries.rbs +11 -21
- data/sig/pg_eventstore/query_builders/basic_filtering.rbs +10 -3
- data/sig/pg_eventstore/query_builders/event_markers_filtering.rbs +17 -0
- data/sig/pg_eventstore/query_builders/event_markers_index_filtering.rbs +69 -0
- data/sig/pg_eventstore/query_builders/event_subscription_positions_filtering.rbs +15 -0
- data/sig/pg_eventstore/query_builders/events_filtering_query.rbs +9 -51
- data/sig/pg_eventstore/query_builders/events_global_index_filtering.rbs +68 -0
- data/sig/pg_eventstore/query_builders/filters/collection.rbs +84 -0
- data/sig/pg_eventstore/query_builders/filters/event_type_filter.rbs +19 -0
- data/sig/pg_eventstore/query_builders/filters/filter_row.rbs +21 -0
- data/sig/pg_eventstore/query_builders/filters/marker_filter.rbs +13 -0
- data/sig/pg_eventstore/query_builders/filters/marker_filter_row.rbs +19 -0
- data/sig/pg_eventstore/query_builders/filters/stream_filter.rbs +24 -0
- data/sig/pg_eventstore/query_builders/index_based_events_filtering.rbs +60 -0
- data/sig/pg_eventstore/query_builders/partitions_filtering.rbs +29 -10
- data/sig/pg_eventstore/query_builders/read_cursor/stream_cursor.rbs +47 -0
- data/sig/pg_eventstore/query_builders/streams_global_index_filtering.rbs +27 -0
- data/sig/pg_eventstore/query_builders/subscription_events_filtering.rbs +26 -0
- data/sig/pg_eventstore/query_strategy/async.rbs +17 -0
- data/sig/pg_eventstore/query_strategy/foreground.rbs +11 -0
- data/sig/pg_eventstore/query_strategy.rbs +7 -0
- data/sig/pg_eventstore/raw_event.rbs +20 -0
- data/sig/pg_eventstore/sql_builder.rbs +32 -10
- data/sig/pg_eventstore/stream.rbs +10 -18
- data/sig/pg_eventstore/stream_global_index.rbs +14 -0
- data/sig/pg_eventstore/subscriptions/callback_handlers/events_processor_handlers.rbs +5 -4
- data/sig/pg_eventstore/subscriptions/callback_handlers/events_subscription_position_worker_handlers.rbs +9 -0
- data/sig/pg_eventstore/subscriptions/callback_handlers/subscription_feeder_handlers.rbs +17 -12
- data/sig/pg_eventstore/subscriptions/callback_handlers/subscription_runner_handlers.rbs +16 -8
- data/sig/pg_eventstore/subscriptions/event_subscription_position_queries.rbs +30 -0
- data/sig/pg_eventstore/subscriptions/events_processor.rbs +12 -5
- data/sig/pg_eventstore/subscriptions/events_processor_consumer/multiple.rbs +17 -0
- data/sig/pg_eventstore/subscriptions/events_processor_consumer/replica.rbs +17 -0
- data/sig/pg_eventstore/subscriptions/events_processor_consumer/single.rbs +17 -0
- data/sig/pg_eventstore/subscriptions/events_processor_consumer.rbs +14 -0
- data/sig/pg_eventstore/subscriptions/events_subscription_position_worker.rbs +28 -0
- data/sig/pg_eventstore/subscriptions/queries/subscription_queries.rbs +18 -50
- data/sig/pg_eventstore/subscriptions/replica_subscription_handler.rbs +33 -0
- data/sig/pg_eventstore/subscriptions/replica_subscription_runner.rbs +4 -0
- data/sig/pg_eventstore/subscriptions/subscription_feed_strategy/collection.rbs +14 -0
- data/sig/pg_eventstore/subscriptions/subscription_feed_strategy/index_read_strategy.rbs +23 -0
- data/sig/pg_eventstore/subscriptions/subscription_feed_strategy/replication_strategy.rbs +23 -0
- data/sig/pg_eventstore/subscriptions/subscription_feed_strategy.rbs +11 -0
- data/sig/pg_eventstore/subscriptions/subscription_feeder.rbs +13 -10
- data/sig/pg_eventstore/subscriptions/subscription_handler_performance.rbs +1 -1
- data/sig/pg_eventstore/subscriptions/subscription_runner.rbs +13 -5
- data/sig/pg_eventstore/subscriptions/subscription_runners_feeder.rbs +5 -5
- data/sig/pg_eventstore/subscriptions/subscriptions_lifecycle.rbs +4 -6
- data/sig/pg_eventstore/subscriptions/subscriptions_manager.rbs +29 -43
- data/sig/pg_eventstore/synchronized_array.rbs +4 -0
- data/sig/pg_eventstore/utils.rbs +18 -11
- data/sig/pg_eventstore/web/application.rbs +13 -3
- data/sig/pg_eventstore/web/paginator/base_collection.rbs +2 -0
- data/sig/pg_eventstore/web/paginator/event_types_collection.rbs +4 -0
- data/sig/pg_eventstore/web/paginator/events_collection.rbs +11 -11
- data/sig/pg_eventstore/web/paginator/helpers.rbs +6 -15
- data/sig/pg_eventstore/web/paginator/markers_collection.rbs +13 -0
- data/sig/pg_eventstore/web/paginator/stream_contexts_collection.rbs +4 -0
- data/sig/pg_eventstore/web/paginator/stream_names_collection.rbs +4 -0
- data/sig/pg_eventstore/web/paginator/streams_collection.rbs +30 -0
- data/sig/pg_eventstore.rbs +8 -26
- metadata +181 -21
- data/lib/pg_eventstore/commands/all_stream_read_grouped.rb +0 -69
- data/lib/pg_eventstore/commands/regular_stream_read_grouped.rb +0 -31
- data/lib/pg_eventstore/subscriptions/queries/service_queries.rb +0 -73
- data/lib/pg_eventstore/subscriptions/subscription_position_evaluation.rb +0 -195
- data/lib/pg_eventstore/web/views/home/partials/system_stream_filter.erb +0 -15
- data/sig/pg_eventstore/commands/all_stream_read_grouped.rbs +0 -16
- data/sig/pg_eventstore/commands/regular_stream_read_grouped.rbs +0 -8
- data/sig/pg_eventstore/subscriptions/queries/service_queries.rbs +0 -15
- data/sig/pg_eventstore/subscriptions/subscription_position_evaluation.rbs +0 -53
- data/sig/pg_eventstore/subscriptions/synchronized_array.rbs +0 -4
- /data/sig/interfaces/{_raw_event_handler.rbs → raw_event_handler.rbs} +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module PgEventstore
|
|
2
|
+
module EventsProcessorConsumer
|
|
3
|
+
class Multiple
|
|
4
|
+
EVENTS_WAIT_TIMEOUT: Integer | Float
|
|
5
|
+
|
|
6
|
+
include EventsProcessorConsumer
|
|
7
|
+
extend ClassMethods
|
|
8
|
+
|
|
9
|
+
@handler: _RawEventsHandler
|
|
10
|
+
|
|
11
|
+
@last_unprocessed_events: Array[Hash[String, untyped]]?
|
|
12
|
+
|
|
13
|
+
def initialize: (_RawEventsHandler handler) -> void
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module PgEventstore
|
|
2
|
+
module EventsProcessorConsumer
|
|
3
|
+
class Replica
|
|
4
|
+
include EventsProcessorConsumer
|
|
5
|
+
|
|
6
|
+
EVENTS_WAIT_TIMEOUT: Float | Integer
|
|
7
|
+
|
|
8
|
+
@handler: Proc
|
|
9
|
+
|
|
10
|
+
@last_unprocessed_events: Array[EventGlobalIndex::SubscriptionRepr]?
|
|
11
|
+
|
|
12
|
+
def self.create_consumer: (Symbol config_name, Symbol replica_config_name) -> Replica
|
|
13
|
+
|
|
14
|
+
def initialize: (Proc handler) -> void
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module PgEventstore
|
|
2
|
+
module EventsProcessorConsumer
|
|
3
|
+
class Single
|
|
4
|
+
EVENT_WAIT_TIMEOUT: Float | Integer
|
|
5
|
+
|
|
6
|
+
include EventsProcessorConsumer
|
|
7
|
+
extend ClassMethods
|
|
8
|
+
|
|
9
|
+
@handler: _RawEventHandler
|
|
10
|
+
|
|
11
|
+
@last_unprocessed_event: Hash[String, untyped]?
|
|
12
|
+
|
|
13
|
+
def initialize: (_RawEventHandler handler) -> void
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module PgEventstore
|
|
2
|
+
module EventsProcessorConsumer
|
|
3
|
+
module ClassMethods
|
|
4
|
+
def create_consumer: (_SubscriptionHandler handler, EventDeserializer deserializer) -> EventsProcessorConsumer
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def self.consumer_class: (bool in_batches) -> Class
|
|
8
|
+
|
|
9
|
+
def call: (Callbacks callbacks, Chunks::Repository repository,
|
|
10
|
+
MonitorMixin::ConditionVariable repository_cond) -> void
|
|
11
|
+
|
|
12
|
+
def clear_unprocessed_events: -> void
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module PgEventstore
|
|
2
|
+
class EventsSubscriptionPositionWorker
|
|
3
|
+
class ReindexTime
|
|
4
|
+
include Extensions::OptionsExtension
|
|
5
|
+
include Extensions::OptionsDefaults
|
|
6
|
+
|
|
7
|
+
attr_accessor time: Time?
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
@basic_runner: BasicRunner
|
|
11
|
+
|
|
12
|
+
@next_reindex_at: ReindexTime
|
|
13
|
+
|
|
14
|
+
attr_reader config_name: Symbol
|
|
15
|
+
|
|
16
|
+
def initialize: (Symbol config_name) -> void
|
|
17
|
+
|
|
18
|
+
private
|
|
19
|
+
|
|
20
|
+
def attach_runner_callbacks: -> void
|
|
21
|
+
|
|
22
|
+
def config: -> Config
|
|
23
|
+
|
|
24
|
+
def connection: -> Connection
|
|
25
|
+
|
|
26
|
+
def event_subscription_position_queries: -> EventSubscriptionPositionQueries
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -1,73 +1,41 @@
|
|
|
1
1
|
module PgEventstore
|
|
2
2
|
class SubscriptionQueries
|
|
3
|
-
|
|
4
|
-
def initialize: (PgEventstore::Connection connection) -> void
|
|
3
|
+
@query_strategy: QueryStrategy
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
def find_or_create_by: (::Hash[untyped, untyped] attrs) -> ::Hash[untyped, untyped]
|
|
5
|
+
attr_accessor connection: Connection
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
def find_by: (::Hash[untyped, untyped] attrs) -> ::Hash[untyped, untyped]?
|
|
7
|
+
def initialize: (Connection connection, QueryStrategy query_strategy) -> void
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
def create_or_replace_table_function: (Integer id, Hash[untyped, untyped] options, Integer locked_by) -> void
|
|
10
|
+
|
|
11
|
+
def find_or_create_by: (::Hash[untyped, untyped] attrs) -> ::Hash[Symbol, untyped]
|
|
12
|
+
|
|
13
|
+
def find_by: (::Hash[untyped, untyped] attrs) -> ::Hash[Symbol, untyped]?
|
|
14
|
+
|
|
15
|
+
def find_all: (::Hash[untyped, untyped] attrs) -> ::Array[::Hash[Symbol, untyped]]
|
|
14
16
|
|
|
15
17
|
def set_collection: (?String? state) -> ::Array[String]
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
def find!: (Integer id) -> ::Hash[untyped, untyped]
|
|
19
|
+
def find!: (Integer id) -> ::Hash[Symbol, untyped]
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
def create: (::Hash[untyped, untyped] attrs) -> ::Hash[untyped, untyped]
|
|
21
|
+
def create: (::Hash[untyped, untyped] attrs) -> ::Hash[Symbol, untyped]
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
#
|
|
25
|
-
# _@param_ `attrs`
|
|
26
|
-
#
|
|
27
|
-
# _@param_ `locked_by`
|
|
28
|
-
def update: (Integer id, attrs: ::Hash[untyped, untyped], locked_by: Integer?) -> ::Hash[untyped, untyped]
|
|
23
|
+
def update: (Integer id, attrs: ::Hash[Symbol, untyped], locked_by: Integer?) -> ::Hash[Symbol, untyped]
|
|
29
24
|
|
|
30
|
-
# _@param_ `subscriptions_set_id` — SubscriptionsSet#id
|
|
31
|
-
#
|
|
32
|
-
# _@param_ `subscriptions_ids` — Array of Subscription#id
|
|
33
25
|
def ping_all: (Integer subscriptions_set_id, ::Array[Integer] subscriptions_ids) -> ::Hash[Integer, Time]
|
|
34
26
|
|
|
35
|
-
# _@param_ `query_options` — runner_id/query options association
|
|
36
|
-
#
|
|
37
|
-
# _@return_ — runner_id/events association
|
|
38
|
-
def subscriptions_events: (::Hash[Integer, ::Hash[untyped, untyped]] query_options) -> ::Hash[Integer, Array[::Hash[untyped, untyped]]]
|
|
39
|
-
|
|
40
|
-
# _@param_ `id` — subscription's id
|
|
41
|
-
#
|
|
42
|
-
# _@param_ `lock_id` — id of the subscriptions set which reserves the subscription
|
|
43
|
-
#
|
|
44
|
-
# _@param_ `force` — whether to lock the subscription despite on #locked_by value
|
|
45
|
-
#
|
|
46
|
-
# _@return_ — lock id
|
|
47
27
|
def lock!: (Integer id, Integer lock_id, ?force: bool) -> Integer
|
|
48
28
|
|
|
49
|
-
# _@param_ `id`
|
|
50
29
|
def delete: (Integer id) -> void
|
|
51
30
|
|
|
52
|
-
|
|
53
|
-
#
|
|
54
|
-
# _@param_ `options` — query options
|
|
55
|
-
def query_builder: (Integer id, ::Hash[untyped, untyped] options) -> PgEventstore::SQLBuilder
|
|
56
|
-
|
|
57
|
-
# _@param_ `builders`
|
|
58
|
-
def union_builders: (::Array[PgEventstore::SQLBuilder] builders) -> PgEventstore::SQLBuilder
|
|
59
|
-
|
|
60
|
-
def transaction_queries: () -> PgEventstore::TransactionQueries
|
|
31
|
+
def union_builders: (::Array[SQLBuilder] builders) -> SQLBuilder
|
|
61
32
|
|
|
62
|
-
def
|
|
33
|
+
def transaction_queries: () -> TransactionQueries
|
|
63
34
|
|
|
64
|
-
|
|
65
|
-
def deserialize: (::Hash[untyped, untyped] hash) -> ::Hash[untyped, untyped]
|
|
35
|
+
def links_resolver: () -> LinksResolver
|
|
66
36
|
|
|
67
|
-
|
|
68
|
-
def find_by_attrs_builder: (::Hash[untyped, untyped] attrs) -> PgEventstore::SQLBuilder
|
|
37
|
+
def deserialize: (::Hash[String, untyped] hash) -> ::Hash[Symbol, untyped]
|
|
69
38
|
|
|
70
|
-
|
|
71
|
-
attr_accessor connection: PgEventstore::Connection
|
|
39
|
+
def find_by_attrs_builder: (::Hash[untyped, untyped] attrs) -> SQLBuilder
|
|
72
40
|
end
|
|
73
41
|
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module PgEventstore
|
|
2
|
+
class ReplicaSubscriptionHandler
|
|
3
|
+
@replica_config_name: Symbol
|
|
4
|
+
@config_name: Symbol
|
|
5
|
+
|
|
6
|
+
def call: (Array[EventGlobalIndex::SubscriptionRepr] indexes) -> void
|
|
7
|
+
|
|
8
|
+
def initialize: (Symbol, Symbol) -> void
|
|
9
|
+
|
|
10
|
+
private
|
|
11
|
+
|
|
12
|
+
def connection: -> Connection
|
|
13
|
+
|
|
14
|
+
def destination_replica_queries: -> ReplicaQueries
|
|
15
|
+
|
|
16
|
+
def records_to_sql: (
|
|
17
|
+
String table_name,
|
|
18
|
+
Array[Symbol] attribute_names,
|
|
19
|
+
Array[Hash[Symbol, untyped]] attributes_collection,
|
|
20
|
+
?on_conflict: String?
|
|
21
|
+
) -> String
|
|
22
|
+
|
|
23
|
+
def reject_already_processed: (
|
|
24
|
+
Array[EventGlobalIndex::SubscriptionRepr] indexes
|
|
25
|
+
) -> Array[EventGlobalIndex::SubscriptionRepr]
|
|
26
|
+
|
|
27
|
+
def replica_connection: -> Connection
|
|
28
|
+
|
|
29
|
+
def replica_transaction_queries: -> TransactionQueries
|
|
30
|
+
|
|
31
|
+
def source_replica_queries: -> ReplicaQueries
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module PgEventstore
|
|
2
|
+
module SubscriptionFeedStrategy[unchecked Runner]
|
|
3
|
+
class Collection < Array[SubscriptionFeedStrategy[SubscriptionRunner] | SubscriptionFeedStrategy[ReplicaSubscriptionRunner]]
|
|
4
|
+
DEFAULT_SUBSCRIPTIONS_NUM_PER_QUERY: Integer
|
|
5
|
+
|
|
6
|
+
def self.create: (
|
|
7
|
+
Array[SubscriptionRunner | ReplicaSubscriptionRunner] runners,
|
|
8
|
+
Connection connection,
|
|
9
|
+
QueryStrategy query_strategy,
|
|
10
|
+
?subscriptions_per_query: Integer
|
|
11
|
+
) -> Collection
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module PgEventstore
|
|
2
|
+
module SubscriptionFeedStrategy[unchecked Runner]
|
|
3
|
+
class IndexReadStrategy
|
|
4
|
+
include SubscriptionFeedStrategy[SubscriptionRunner]
|
|
5
|
+
|
|
6
|
+
INDEX_LOOK_UP_DISTANCE: Integer
|
|
7
|
+
|
|
8
|
+
@connection: Connection
|
|
9
|
+
@query_strategy: QueryStrategy
|
|
10
|
+
@runners: Array[SubscriptionRunner]
|
|
11
|
+
|
|
12
|
+
def initialize: (Connection connection, QueryStrategy query_strategy) -> void
|
|
13
|
+
|
|
14
|
+
private
|
|
15
|
+
|
|
16
|
+
def event_subscription_position_queries: -> EventSubscriptionPositionQueries
|
|
17
|
+
|
|
18
|
+
def events_global_index_queries: -> EventsGlobalIndexQueries
|
|
19
|
+
|
|
20
|
+
def safe_position: -> Integer
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module PgEventstore
|
|
2
|
+
module SubscriptionFeedStrategy[unchecked Runner]
|
|
3
|
+
class ReplicationStrategy
|
|
4
|
+
include SubscriptionFeedStrategy[ReplicaSubscriptionRunner]
|
|
5
|
+
|
|
6
|
+
INDEX_LOOK_UP_DISTANCE: Integer
|
|
7
|
+
|
|
8
|
+
@connection: Connection
|
|
9
|
+
@query_strategy: QueryStrategy
|
|
10
|
+
@runners: Array[ReplicaSubscriptionRunner]
|
|
11
|
+
|
|
12
|
+
def initialize: (Connection connection, QueryStrategy query_strategy) -> void
|
|
13
|
+
|
|
14
|
+
private
|
|
15
|
+
|
|
16
|
+
def event_subscription_position_queries: -> EventSubscriptionPositionQueries
|
|
17
|
+
|
|
18
|
+
def events_global_index_queries: -> EventsGlobalIndexQueries
|
|
19
|
+
|
|
20
|
+
def safe_position: -> Integer
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -4,26 +4,27 @@ module PgEventstore
|
|
|
4
4
|
|
|
5
5
|
extend Forwardable
|
|
6
6
|
|
|
7
|
-
@basic_runner:
|
|
8
|
-
@commands_handler:
|
|
9
|
-
@
|
|
10
|
-
@
|
|
7
|
+
@basic_runner: BasicRunner
|
|
8
|
+
@commands_handler: CommandsHandler
|
|
9
|
+
@events_subscription_position_worker: EventsSubscriptionPositionWorker?
|
|
10
|
+
@subscriptions_lifecycle: SubscriptionsLifecycle
|
|
11
|
+
@subscriptions_set_lifecycle: SubscriptionsSetLifecycle
|
|
11
12
|
|
|
12
13
|
attr_reader config_name: Symbol
|
|
13
14
|
|
|
14
15
|
def initialize: (
|
|
15
16
|
config_name: Symbol,
|
|
16
|
-
subscriptions_set_lifecycle:
|
|
17
|
-
subscriptions_lifecycle:
|
|
17
|
+
subscriptions_set_lifecycle: SubscriptionsSetLifecycle,
|
|
18
|
+
subscriptions_lifecycle: SubscriptionsLifecycle
|
|
18
19
|
) -> void
|
|
19
20
|
|
|
20
|
-
def id:
|
|
21
|
+
def id: -> Integer?
|
|
21
22
|
|
|
22
|
-
def start_all:
|
|
23
|
+
def start_all: -> void
|
|
23
24
|
|
|
24
|
-
def stop_all:
|
|
25
|
+
def stop_all: -> void
|
|
25
26
|
|
|
26
|
-
def attach_runner_callbacks:
|
|
27
|
+
def attach_runner_callbacks: -> void
|
|
27
28
|
|
|
28
29
|
private
|
|
29
30
|
|
|
@@ -31,5 +32,7 @@ module PgEventstore
|
|
|
31
32
|
Symbol config_name,
|
|
32
33
|
SubscriptionsSetLifecycle subscriptions_set_lifecycle
|
|
33
34
|
) -> Array[RunnerRecoveryStrategy]
|
|
35
|
+
|
|
36
|
+
def requires_subscription_position_assignment?: -> bool
|
|
34
37
|
end
|
|
35
38
|
end
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
module PgEventstore
|
|
2
2
|
class SubscriptionRunner
|
|
3
3
|
extend Forwardable
|
|
4
|
-
|
|
4
|
+
DEFAULT_MAX_EVENTS_PER_CHUNK: Integer
|
|
5
5
|
MIN_EVENTS_PER_CHUNK: Integer
|
|
6
|
-
|
|
6
|
+
DEFAULT_INITIAL_EVENTS_PER_CHUNK: Integer
|
|
7
|
+
|
|
8
|
+
@events_processor: EventsProcessor
|
|
9
|
+
@initial_events_per_chunk: Integer
|
|
10
|
+
@max_events_per_chunk: Integer
|
|
11
|
+
@stats: SubscriptionHandlerPerformance
|
|
7
12
|
|
|
8
13
|
# Returns the value of attribute subscription.
|
|
9
14
|
attr_reader subscription: Subscription
|
|
@@ -12,13 +17,12 @@ module PgEventstore
|
|
|
12
17
|
stats: SubscriptionHandlerPerformance,
|
|
13
18
|
events_processor: EventsProcessor,
|
|
14
19
|
subscription: Subscription,
|
|
15
|
-
|
|
20
|
+
?initial_events_per_chunk: Integer,
|
|
21
|
+
?max_events_per_chunk: Integer,
|
|
16
22
|
) -> void
|
|
17
23
|
|
|
18
24
|
def next_chunk_query_opts: () -> ::Hash[untyped, untyped]
|
|
19
25
|
|
|
20
|
-
def next_chunk_safe?: -> bool
|
|
21
|
-
|
|
22
26
|
def time_to_feed?: () -> bool
|
|
23
27
|
|
|
24
28
|
def next_chunk_global_position: () -> Integer
|
|
@@ -26,5 +30,9 @@ module PgEventstore
|
|
|
26
30
|
def estimate_events_number: () -> Integer
|
|
27
31
|
|
|
28
32
|
def attach_callbacks: () -> void
|
|
33
|
+
|
|
34
|
+
private
|
|
35
|
+
|
|
36
|
+
def subscription_from_position: -> Integer
|
|
29
37
|
end
|
|
30
38
|
end
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
module PgEventstore
|
|
2
2
|
class SubscriptionRunnersFeeder
|
|
3
|
-
|
|
3
|
+
@config_name: Symbol
|
|
4
|
+
|
|
4
5
|
def initialize: (Symbol config_name) -> void
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
def feed: (::Array[PgEventstore::SubscriptionRunner] runners) -> void
|
|
7
|
+
def feed: (::Array[SubscriptionRunner] runners) -> void
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
private
|
|
10
10
|
|
|
11
|
-
def
|
|
11
|
+
def connection: -> Connection
|
|
12
12
|
end
|
|
13
13
|
end
|
|
@@ -4,15 +4,15 @@ module PgEventstore
|
|
|
4
4
|
|
|
5
5
|
@config_name: Symbol
|
|
6
6
|
|
|
7
|
-
@subscriptions_set_lifecycle:
|
|
7
|
+
@subscriptions_set_lifecycle: SubscriptionsSetLifecycle
|
|
8
8
|
|
|
9
9
|
@subscriptions_pinged_at: Time
|
|
10
10
|
|
|
11
11
|
@force_lock: bool
|
|
12
12
|
|
|
13
|
-
attr_reader runners: Array[
|
|
13
|
+
attr_reader runners: Array[SubscriptionRunner]
|
|
14
14
|
|
|
15
|
-
def initialize: (Symbol config_name,
|
|
15
|
+
def initialize: (Symbol config_name, SubscriptionsSetLifecycle subscriptions_set_lifecycle, ?force_lock: bool)-> void
|
|
16
16
|
|
|
17
17
|
def force_locked?: -> bool
|
|
18
18
|
|
|
@@ -20,8 +20,6 @@ module PgEventstore
|
|
|
20
20
|
|
|
21
21
|
def ping_subscriptions: -> void
|
|
22
22
|
|
|
23
|
-
def subscriptions: -> Array[
|
|
24
|
-
|
|
25
|
-
def force_lock!: -> void
|
|
23
|
+
def subscriptions: -> Array[Subscription]
|
|
26
24
|
end
|
|
27
25
|
end
|
|
@@ -3,46 +3,36 @@ module PgEventstore
|
|
|
3
3
|
extend Forwardable
|
|
4
4
|
|
|
5
5
|
@set_name: String
|
|
6
|
-
@subscription_feeder:
|
|
7
|
-
@subscriptions_lifecycle:
|
|
8
|
-
@subscriptions_set_lifecycle:
|
|
9
|
-
|
|
10
|
-
def self.callbacks: () ->
|
|
11
|
-
|
|
12
|
-
# _@param_ `config`
|
|
13
|
-
#
|
|
14
|
-
# _@param_ `set_name`
|
|
15
|
-
#
|
|
16
|
-
# _@param_ `max_retries` — max number of retries of failed SubscriptionsSet
|
|
17
|
-
#
|
|
18
|
-
# _@param_ `retries_interval` — a delay between retries of failed SubscriptionsSet
|
|
6
|
+
@subscription_feeder: SubscriptionFeeder
|
|
7
|
+
@subscriptions_lifecycle: SubscriptionsLifecycle
|
|
8
|
+
@subscriptions_set_lifecycle: SubscriptionsSetLifecycle
|
|
9
|
+
|
|
10
|
+
def self.callbacks: () -> Callbacks
|
|
11
|
+
|
|
19
12
|
def initialize: (
|
|
20
|
-
config:
|
|
13
|
+
config: Config,
|
|
21
14
|
set_name: String,
|
|
22
15
|
?max_retries: Integer?,
|
|
23
16
|
?retries_interval: Integer?,
|
|
24
17
|
?force_lock: bool
|
|
25
18
|
) -> void
|
|
26
19
|
|
|
20
|
+
def create_replication: (
|
|
21
|
+
String subscription_name,
|
|
22
|
+
Symbol primary_config_name,
|
|
23
|
+
?options: ::Hash[untyped, untyped],
|
|
24
|
+
?max_events_to_replicate: Integer,
|
|
25
|
+
?pull_interval: Integer | Float,
|
|
26
|
+
?max_retries: Integer,
|
|
27
|
+
?retries_interval: Integer | Float,
|
|
28
|
+
?restart_terminator: _RestartTerminator?,
|
|
29
|
+
?failed_subscription_notifier: _FailedSubscriptionNotifier?,
|
|
30
|
+
?graceful_shutdown_timeout: Integer | Float,
|
|
31
|
+
?in_batches: bool,
|
|
32
|
+
) -> void
|
|
33
|
+
|
|
27
34
|
def config_name: () -> Symbol
|
|
28
35
|
|
|
29
|
-
# _@param_ `subscription_name` — subscription's name
|
|
30
|
-
#
|
|
31
|
-
# _@param_ `handler` — subscription's handler
|
|
32
|
-
#
|
|
33
|
-
# _@param_ `options` — request options
|
|
34
|
-
#
|
|
35
|
-
# _@param_ `middlewares` — provide a list of middleware names to override a config's middlewares
|
|
36
|
-
#
|
|
37
|
-
# _@param_ `pull_interval` — an interval in seconds to determine how often to query new events of the given subscription.
|
|
38
|
-
#
|
|
39
|
-
# _@param_ `max_retries` — max number of retries of failed Subscription
|
|
40
|
-
#
|
|
41
|
-
# _@param_ `retries_interval` — a delay between retries of failed Subscription
|
|
42
|
-
#
|
|
43
|
-
# _@param_ `restart_terminator` — a callable object which is invoked with PgEventstore::Subscription instance to determine whether restarts should be stopped(true - stops restarts, false - continues restarts)
|
|
44
|
-
#
|
|
45
|
-
# _@param_ `failed_subscription_notifier` - a callable object which is invoked with PgEventstore::Subscription instance and error instance after the related subscription died due to error and no longer can be automatically restarted due to max retries number reached. You can use this hook to send a notification about failed subscription.
|
|
46
36
|
def subscribe: (
|
|
47
37
|
String subscription_name,
|
|
48
38
|
handler: _SubscriptionHandler,
|
|
@@ -54,26 +44,22 @@ module PgEventstore
|
|
|
54
44
|
?restart_terminator: _RestartTerminator?,
|
|
55
45
|
?failed_subscription_notifier: _FailedSubscriptionNotifier?,
|
|
56
46
|
?graceful_shutdown_timeout: Integer | Float,
|
|
47
|
+
?in_batches: bool,
|
|
57
48
|
) -> void
|
|
58
49
|
|
|
59
|
-
def subscriptions: () -> ::Array[
|
|
50
|
+
def subscriptions: () -> ::Array[Subscription]
|
|
60
51
|
|
|
61
|
-
def subscriptions_set: () ->
|
|
52
|
+
def subscriptions_set: () -> SubscriptionsSet?
|
|
62
53
|
|
|
63
|
-
|
|
64
|
-
#
|
|
65
|
-
# _@param_ `handler`
|
|
66
|
-
def create_raw_event_handler: (::Array[Symbol]? middlewares, _SubscriptionHandler handler) -> _RawEventHandler
|
|
54
|
+
def deserializer: (::Array[Symbol]? middlewares) -> EventDeserializer
|
|
67
55
|
|
|
68
|
-
|
|
69
|
-
def select_middlewares: (?::Array[Symbol]? middlewares) -> ::Array[PgEventstore::Middleware]
|
|
56
|
+
def select_middlewares: (?::Array[Symbol]? middlewares) -> ::Array[Middleware]
|
|
70
57
|
|
|
71
|
-
def start!: () ->
|
|
58
|
+
def start!: () -> BasicRunner
|
|
72
59
|
|
|
73
|
-
def start: () ->
|
|
60
|
+
def start: () -> BasicRunner?
|
|
74
61
|
|
|
75
|
-
|
|
76
|
-
attr_accessor config: PgEventstore::Config
|
|
62
|
+
attr_accessor config: Config
|
|
77
63
|
|
|
78
64
|
private
|
|
79
65
|
|
data/sig/pg_eventstore/utils.rbs
CHANGED
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
module PgEventstore
|
|
2
2
|
class Utils
|
|
3
|
-
|
|
4
|
-
def self.deep_transform_keys: (untyped object) { (untyped key) -> untyped } -> Object
|
|
3
|
+
def self.assert!: (boolish truthy, String? message) -> void
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
def self.assert_node_role!: (Config config, Array[Symbol] expected_roles) -> void
|
|
6
|
+
|
|
7
|
+
def self.benchmark: { -> untyped } -> Float
|
|
8
|
+
|
|
9
|
+
def self.deep_transform_keys: (untyped object) { (untyped key) -> untyped } -> untyped
|
|
10
|
+
|
|
11
|
+
def self.deep_dup: (untyped object) -> untyped
|
|
8
12
|
|
|
9
13
|
def self.deprecation_warning: (String message) -> void
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
# _@return_ — positional variables, based on array size. Example: "$1, $2, $3"
|
|
15
|
+
def self.missing_implementation!: (untyped obj) -> void
|
|
16
|
+
|
|
14
17
|
def self.positional_vars: (::Array[untyped] array) -> String
|
|
15
18
|
|
|
16
|
-
# _@param_ `error`
|
|
17
19
|
def self.error_info: (StandardError error) -> ::Hash[untyped, untyped]
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
def self.read_pid: (String file_path) -> String?
|
|
22
|
+
|
|
23
|
+
def self.remove_file: (String file_path) -> void
|
|
24
|
+
|
|
20
25
|
def self.underscore_str: (String str) -> String
|
|
21
26
|
|
|
22
27
|
def self.original_global_position: (Hash[untyped, untyped] raw_event) -> Integer
|
|
23
28
|
|
|
24
|
-
def self.unwrap_exception: (
|
|
29
|
+
def self.unwrap_exception: (WrappedException | StandardError wrapped_exception) -> StandardError
|
|
30
|
+
|
|
31
|
+
def self.wrap_exception: (StandardError exception, **untyped extra) -> WrappedException
|
|
25
32
|
|
|
26
|
-
def self.
|
|
33
|
+
def self.write_to_file: (String file_path, String content) -> void
|
|
27
34
|
end
|
|
28
35
|
end
|
|
@@ -11,7 +11,7 @@ module PgEventstore
|
|
|
11
11
|
|
|
12
12
|
def asset_url: (String path) -> String
|
|
13
13
|
|
|
14
|
-
def connection: ->
|
|
14
|
+
def connection: -> Connection
|
|
15
15
|
|
|
16
16
|
def current_config: -> Symbol
|
|
17
17
|
|
|
@@ -19,13 +19,15 @@ module PgEventstore
|
|
|
19
19
|
|
|
20
20
|
def escape_empty_string: (String? string) -> String?
|
|
21
21
|
|
|
22
|
-
def events_filter: -> Array[String]
|
|
22
|
+
def events_filter: -> Array[String | Hash[untyped, untyped]]
|
|
23
23
|
|
|
24
24
|
def flash_message=: (({ message: String, kind: String }) val)-> String
|
|
25
25
|
|
|
26
26
|
def h: (String text) -> String
|
|
27
27
|
|
|
28
|
-
def
|
|
28
|
+
def markers_filter: -> Array[String]
|
|
29
|
+
|
|
30
|
+
def paginated_json_response: (Paginator::BaseCollection collection) -> void
|
|
29
31
|
|
|
30
32
|
def redirect_back_url: (fallback_url: String) -> String
|
|
31
33
|
|
|
@@ -38,6 +40,14 @@ module PgEventstore
|
|
|
38
40
|
def system_stream: -> String?
|
|
39
41
|
|
|
40
42
|
def unescape_empty_string: (String? string) -> String?
|
|
43
|
+
|
|
44
|
+
def extract_event_types_filter: (Hash[untyped, untyped] options) -> Array[String | Hash[untyped, untyped]]
|
|
45
|
+
|
|
46
|
+
def extract_streams_filter: (Hash[untyped, untyped] options) -> Array[Hash[untyped, untyped]]
|
|
47
|
+
|
|
48
|
+
private
|
|
49
|
+
|
|
50
|
+
def normalize_markers: (Hash[untyped, untyped] hash) -> Array[String]
|
|
41
51
|
end
|
|
42
52
|
end
|
|
43
53
|
end
|