nexus_cqrs 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 847a980fa9ad933433817673a5a306453b7e293a38a41c12e355dd5f4d1e991e
|
4
|
+
data.tar.gz: e1041424ef479676ca5fddb56c503f7b353dd40f9f1220335842e1e1fb443524
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa430242485a2080a494b26805dc0d36f437625494dda151757418006f929f8cce1ad937cc31bc1f1f763fd46e1e7598cfb09f65bb93d7349a135e3e63083e7f
|
7
|
+
data.tar.gz: 8f41e2f25102d6ccf1d220054f7ea5885217fe337e5c066489895920a65697b8d1f2a15040588f441754cfccc5390e9ed98100698d47de82b12a31d40d34772f
|
@@ -16,7 +16,7 @@ module NexusCqrs
|
|
16
16
|
template "register_cqrs_handlers.rb", handler_config
|
17
17
|
end
|
18
18
|
|
19
|
-
inject_into_file handler_config, "
|
19
|
+
inject_into_file handler_config, "$QUERY_EXECUTOR.register_command(Queries::Stripe::GetCustomerById, Queries::Stripe::GetCustomerByIdHandler)", after: "# Register Commands"
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -1,4 +1,9 @@
|
|
1
1
|
command_bus = NexusCqrs::CommandBus.new
|
2
2
|
query_bus = NexusCqrs::CommandBus.new
|
3
3
|
|
4
|
-
$
|
4
|
+
$COMMAND_EXECUTOR = NexusCqrs::CommandExecutor.new command_bus
|
5
|
+
$QUERY_EXECUTOR = NexusCqrs::CommandExecutor.new query_bus
|
6
|
+
|
7
|
+
# Register Queries
|
8
|
+
|
9
|
+
# Register Commands
|
data/lib/nexus_cqrs/helpers.rb
CHANGED
@@ -2,17 +2,12 @@ module NexusCqrs
|
|
2
2
|
module Helpers
|
3
3
|
# Executes a CQRS Command
|
4
4
|
def execute(command)
|
5
|
-
|
5
|
+
$COMMAND_EXECUTOR.execute(command)
|
6
6
|
end
|
7
7
|
|
8
8
|
# Executes a CQRS Query
|
9
9
|
def query(query)
|
10
|
-
|
11
|
-
end
|
12
|
-
|
13
|
-
# Provide access to the CQRS executor
|
14
|
-
def command_executor
|
15
|
-
@command_executor ||= NexusCqrs::CommandExecutor.new
|
10
|
+
$QUERY_EXECUTOR.execute(query)
|
16
11
|
end
|
17
12
|
end
|
18
13
|
end
|
data/lib/nexus_cqrs/version.rb
CHANGED