ruby_event_store-sidekiq_scheduler 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0cdf5e021a8997a018686a6c17eb62df9cbd9153dbd805af529e216777287ad3
4
+ data.tar.gz: 28de9a1269df9d5aa47f69301cd8d1486b48e0743d75cdbad6159c996b06fde8
5
+ SHA512:
6
+ metadata.gz: ca0c664892ed5a1868bd5378e0c7d8d4b0246c9fc762317f94c24429ba6806dc5f5c5d55ace6aff5f362bb29358f881500e264b9f9a10c3be0dd7a144992571e
7
+ data.tar.gz: 6f9cc016556329ef6ff2e87f65c5d76b0fa3985863d5f0a18bae227d652e721c12b72e8dabd65b20876ebec74b811bb56591e4af3ccb9756fd4cfe2952a3cd40
@@ -0,0 +1,28 @@
1
+ # Ruby Event Store Sidekiq Scheduler
2
+
3
+ A library to schedule Ruby Event Store handlers to sidekiq.
4
+
5
+ ![Ruby Event Store Sidekiq Scheduler](https://github.com/RailsEventStore/rails_event_store/workflows/ruby_event_store-sidekiq_scheduler/badge.svg)
6
+
7
+ ## How to use this gem
8
+
9
+ Add to your gemfile in application:
10
+
11
+ ```ruby
12
+ gem "ruby_event_store-sidekiq_scheduler"
13
+ ```
14
+
15
+ Declare the scheduler in your Ruby Event Store configuration. We recommend to use it with `AfterCommitAsyncDispatcher`
16
+
17
+ ```ruby
18
+ event_store = RailsEventStore::Client.new(
19
+ dispatcher: RailsEventStore::AfterCommitAsyncDispatcher.new(scheduler: RubyEventStore::SidekiqScheduler.new),
20
+ )
21
+ ```
22
+
23
+ Read more about [using asynchronous handlers](https://railseventstore.org/docs/v2/subscribe/#async-handlers)
24
+
25
+
26
+ ## Contributing
27
+
28
+ Bug reports and pull requests are welcome on GitHub at https://github.com/RailsEventStore/rails_event_store.
@@ -0,0 +1,20 @@
1
+ require 'sidekiq'
2
+
3
+ module RubyEventStore
4
+ class SidekiqScheduler
5
+ def initialize(serializer:)
6
+ @serializer = serializer
7
+ end
8
+
9
+ def call(klass, record)
10
+ klass.perform_async(record.serialize(serializer).to_h)
11
+ end
12
+
13
+ def verify(subscriber)
14
+ Class === subscriber && !!(subscriber < Sidekiq::Worker)
15
+ end
16
+
17
+ private
18
+ attr_reader :serializer
19
+ end
20
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyEventStore
4
+ class SidekiqScheduler
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby_event_store-sidekiq_scheduler
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Arkency
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-01-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ruby_event_store
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.0.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: 3.0.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 2.0.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: 3.0.0
33
+ description:
34
+ email: dev@arkency.com
35
+ executables: []
36
+ extensions: []
37
+ extra_rdoc_files:
38
+ - README.md
39
+ files:
40
+ - README.md
41
+ - lib/ruby_event_store/sidekiq_scheduler.rb
42
+ - lib/ruby_event_store/sidekiq_scheduler/version.rb
43
+ homepage: https://railseventstore.org
44
+ licenses:
45
+ - MIT
46
+ metadata:
47
+ homepage_uri: https://railseventstore.org
48
+ source_code_uri: https://github.com/RailsEventStore/rails_event_store
49
+ bug_tracker_uri: https://github.com/RailsEventStore/rails_event_store/issues
50
+ post_install_message:
51
+ rdoc_options: []
52
+ require_paths:
53
+ - lib
54
+ required_ruby_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: '2.5'
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ requirements: []
65
+ rubygems_version: 3.0.3
66
+ signing_key:
67
+ specification_version: 4
68
+ summary: Ruby Event Store scheduler for sidekiq
69
+ test_files: []