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 +4 -4
- data/lib/pakyow/ui/behavior/rendering.rb +16 -5
- data/lib/pakyow/ui/framework.rb +16 -1
- metadata +28 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f28daa632cb4c9af951f247e1e30235e165af6f6fe4857ce5d1cb9e4fe6518e8
|
4
|
+
data.tar.gz: c509c297286b3c7ee0a07348d1d6d83b1a5aa1f6f637afd900fee5e52669c9c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/pakyow/ui/framework.rb
CHANGED
@@ -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
|
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.
|
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-
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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: []
|