pakyow-ui 1.0.0.rc3 → 1.0.0.rc4

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: d71de7c4e616ea74f475244bcf2d83514545ae0fb9e7d7609c193613c31126ea
4
- data.tar.gz: 29ae12773c22127cf94ab2a7af917d6bc25be49aa22162c640c1e55a2b1ea357
3
+ metadata.gz: f28daa632cb4c9af951f247e1e30235e165af6f6fe4857ce5d1cb9e4fe6518e8
4
+ data.tar.gz: c509c297286b3c7ee0a07348d1d6d83b1a5aa1f6f637afd900fee5e52669c9c4
5
5
  SHA512:
6
- metadata.gz: 5ffb9202ded41dfe84049bb045bb96550f71cdae8e257388d246663e7359e1f97e3d65601fad724d695a4362f49933f62482240eb95b344392d08b8a913fb2a5
7
- data.tar.gz: 1af8c6b47fef55f85560c0308c6d739ae5021af3c7001f50cb7f10380d96f9b0a5b70aaa3894044562fb81e0b301f6872dd8b46d4a2a44a5f7ffa7dc274d5eb1
6
+ metadata.gz: d44ceb00c61e47a10157e278d1f6c5d7761b1b48e2b4654d0009c9014db02749e76bf438638e8f4598d02fba22623df6dd40007adb0b4949e7c6d53ff2bc3d6e
7
+ data.tar.gz: dcfcb26cabafe793539a90dee51a9047fe4c652fbb018df79b3cbd76df7337b08cf373453ca9317f4243bc3533c61709e5797dcc3a47e0ada813d98d376e5661
@@ -51,24 +51,35 @@ module Pakyow
51
51
  renderer: ui_renderer_instance
52
52
  }
53
53
 
54
- payload = {
54
+ @payload = {
55
55
  metadata: Marshal.dump(metadata)
56
56
  }
57
57
 
58
58
  # Generate a unique id based on the value of the metadata. This guarantees that the
59
59
  # transformation id will be consistent across subscriptions.
60
60
  #
61
- transformation_id = Digest::SHA1.hexdigest(payload[:metadata])
61
+ transformation_id = Digest::SHA1.hexdigest(@payload[:metadata])
62
62
  presentables[:__transformation_id] = transformation_id
63
- payload[:transformation_id] = transformation_id
63
+ @payload[:transformation_id] = transformation_id
64
+ @payload[:id] = transformation_id
65
+ end
66
+ end
67
+ end
68
+
69
+ after "render" do
70
+ if instance_variable_defined?(:@payload)
71
+ @app.ui_executor.post(self, subscribables, @payload, Pakyow.logger.target) do |context, subscribables, payload, logger|
72
+ logger.internal {
73
+ "[ui] subscribing #{@payload[:id]}"
74
+ }
64
75
 
65
76
  # Find every subscribable presentable, creating a data subscription for each.
66
77
  #
67
78
  subscribables.each do |subscribable|
68
- subscribable.subscribe(socket_client_id, handler: Handler, payload: payload) do |ids|
79
+ subscribable.subscribe(context.socket_client_id, handler: Handler, payload: payload) do |ids|
69
80
  # Subscribe the subscriptions to the "transformation" channel.
70
81
  #
71
- subscribe(:transformation, *ids.uniq)
82
+ context.subscribe(:transformation, *ids.uniq)
72
83
  end
73
84
  end
74
85
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "concurrent/executor/thread_pool_executor"
4
+
3
5
  require "pakyow/framework"
4
6
 
5
7
  require "pakyow/ui/helpers"
@@ -65,9 +67,22 @@ module Pakyow
65
67
  const_set(:UIRenderer, ui_renderer)
66
68
  end
67
69
 
68
- after :initialize do
70
+ after "initialize" do
69
71
  config.data.subscriptions.version = config.version
70
72
  end
73
+
74
+ # @api private
75
+ attr_reader :ui_executor
76
+ unfreezable :ui_executor
77
+
78
+ after "initialize" do
79
+ @ui_executor = Concurrent::ThreadPoolExecutor.new(
80
+ auto_terminate: false,
81
+ min_threads: 1,
82
+ max_threads: 10,
83
+ max_queue: 0
84
+ )
85
+ end
71
86
  end
72
87
  end
73
88
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pakyow-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc3
4
+ version: 1.0.0.rc4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Powell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-09 00:00:00.000000000 Z
11
+ date: 2019-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pakyow-core
@@ -16,84 +16,98 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.0.rc3
19
+ version: 1.0.0.rc4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.0.rc3
26
+ version: 1.0.0.rc4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pakyow-data
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 1.0.0.rc3
33
+ version: 1.0.0.rc4
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 1.0.0.rc3
40
+ version: 1.0.0.rc4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pakyow-presenter
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 1.0.0.rc3
47
+ version: 1.0.0.rc4
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 1.0.0.rc3
54
+ version: 1.0.0.rc4
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pakyow-realtime
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 1.0.0.rc3
61
+ version: 1.0.0.rc4
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 1.0.0.rc3
68
+ version: 1.0.0.rc4
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: pakyow-routing
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 1.0.0.rc3
75
+ version: 1.0.0.rc4
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 1.0.0.rc3
82
+ version: 1.0.0.rc4
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: pakyow-support
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 1.0.0.rc3
89
+ version: 1.0.0.rc4
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 1.0.0.rc3
96
+ version: 1.0.0.rc4
97
+ - !ruby/object:Gem::Dependency
98
+ name: concurrent-ruby
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.1'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.1'
97
111
  description: Auto-Updating UIs for Pakyow
98
112
  email: bryan@metabahn.com
99
113
  executables: []