nexaas-async-collector 2.0.0 → 2.0.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd105d4c6505a8685e63015fd36b925a75428713
|
4
|
+
data.tar.gz: f8157cfabc5dce639e3173cb1cc3c23de4b824f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 919211a341e607fbab736199facc7527d23fb487a4061b26177b3008b804b98cbf518d76831ef01440a47b6d84f28159b2f95d3a19992ebf058a506f25129c7b
|
7
|
+
data.tar.gz: 07f37e64d7251837927ad94a35c4dff98f21100bb3b48be9f2a14315f3c20dc05c69b49fd715f4d72803408127ea51e5fc70fccc3a19296b5bee32927d8375f4
|
data/README.md
CHANGED
@@ -70,7 +70,7 @@ end
|
|
70
70
|
|
71
71
|
```ruby
|
72
72
|
<%= nexaas_async_collect({
|
73
|
-
|
73
|
+
scope_id: scope.id, # (required) the ID of the scope. It ensures only the scope who requested the data will be able to fetch it
|
74
74
|
class_name: ModelService, # (required) name of the class
|
75
75
|
class_method: :model_method, # (required) name of the class method responsible to generate data
|
76
76
|
args: [arg1, arg2], # (optional) arguments to be passed to class method
|
@@ -4,7 +4,7 @@ module Nexaas
|
|
4
4
|
module ApplicationHelper
|
5
5
|
#
|
6
6
|
# Helper to enqueue AsyncResourceJob and include the JavaScript code to request the result
|
7
|
-
# -
|
7
|
+
# - scope_id: an ID that is unique (maybe user.id, account.id, organization.id, etc)
|
8
8
|
# - klass_name: The name of the class responsible for generate the content to be stored in the memory
|
9
9
|
# - klass_method: The name of the class method to be called
|
10
10
|
# - args: The arguments to be passed in the call of the class method
|
@@ -10,7 +10,7 @@ module Nexaas
|
|
10
10
|
initialize_options(opts)
|
11
11
|
start_time = Time.current.to_i
|
12
12
|
instrument_start(start_time)
|
13
|
-
Persist.save(@
|
13
|
+
Persist.save(@scope_id, @collect_id, generate_content)
|
14
14
|
instrument_finish(start_time)
|
15
15
|
end
|
16
16
|
|
@@ -32,7 +32,7 @@ module Nexaas
|
|
32
32
|
|
33
33
|
def instrument_start(start_time)
|
34
34
|
ActiveSupport::Notifications.instrument("#{instrumentation_context}.start", {
|
35
|
-
collect_id: @collect_id,
|
35
|
+
collect_id: @collect_id, scope_id: @scope_id,
|
36
36
|
class_name: @class_name, class_method: @class_method,
|
37
37
|
start: start_time
|
38
38
|
})
|
@@ -42,7 +42,7 @@ module Nexaas
|
|
42
42
|
finish = Time.current.to_i
|
43
43
|
duration = (finish - start_time)
|
44
44
|
ActiveSupport::Notifications.instrument("#{instrumentation_context}.finish", {
|
45
|
-
collect_id: @collect_id,
|
45
|
+
collect_id: @collect_id, scope_id: @scope_id,
|
46
46
|
class_name: @class_name, class_method: @class_method,
|
47
47
|
finish: finish, duration: duration
|
48
48
|
})
|