isomorfeus-transport 23.6.0.rc4 → 23.6.0.rc5

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: 9d5a337a47da0a199bc987865edf18f97858288f7dfe7901b6bad0dbc40d3f1e
4
- data.tar.gz: c564283dff2e184318a3617c290cb15675a42d56689069b01555667a62b1ce6a
3
+ metadata.gz: 71c4133dbd6db3a7ec68fd33734724492990159ac0930baec3de275f5690a3ef
4
+ data.tar.gz: 4a7136266a220ebf889e0b51ad201adc5df1e5fbf79322ccc10281e3752cb7bf
5
5
  SHA512:
6
- metadata.gz: 1ca77316e1285cfe7c9fbc409ca31e0fd0879610398e9ce3e37594c63ea02df2e9835eb78945f2a18538d7cbc574e5b7d113ca25894d99e1103356b340410d4d
7
- data.tar.gz: 903c65c56b7f4d621ed12edbc35094333a0cbdcf12d3843cf388e1802065534837331ad52aa03c60ff19295bfbb19620159e19a043c02bf53a5dcc67ad063be0
6
+ metadata.gz: 6a9de85ee25d6581ddc4380f5305288e07dbb7db7df37ff1d0c85ea15826cbb6b7bde3ace5037cd44893d94b76258c60b7491aacdd24b9c1a09cd4a34dabbbd6
7
+ data.tar.gz: e05b34fd3c4a762b5287801f946a5fcff29360a7d8b130c88fdba3ac0752d7396c8f771786bcab27ad39f021d83307ea70a5301a5ae24f285b4588def56f66d9
@@ -1,24 +1,12 @@
1
1
  module Kernel
2
- def promise(&block)
3
- p = Promise.new
4
-
2
+ def promise(p = Promise.new, &block)
5
3
  begin
6
4
  result = block.call
7
5
  return p.resolve(result) if result
6
+ after(10) { promise(p, &block) }
8
7
  rescue => e
9
8
  return p.reject(e)
10
9
  end
11
-
12
- pr = proc do
13
- begin
14
- res = block.call
15
- res ? p.resolve(res) : after(10, &pr)
16
- rescue => e
17
- p.reject(e)
18
- end
19
- end
20
-
21
- after(10, &pr)
22
10
  p
23
11
  end
24
12
 
@@ -33,13 +21,6 @@ module Kernel
33
21
  def after(time_ms, &block)
34
22
  `setTimeout(#{block.to_n}, time_ms)`
35
23
  end
36
-
37
- # TODO remove before release
38
- %x{
39
- Opal.s = function() {
40
- return Opal.Isomorfeus.store.$get_state().$to_n();
41
- }
42
- }
43
24
  else
44
25
  def on_browser?; false; end
45
26
  def on_desktop?; false; end
@@ -22,7 +22,7 @@ module Isomorfeus
22
22
  response_agent.error = { error: { handler_class_name => 'No such handler!'}}
23
23
  end
24
24
  rescue Exception => e
25
- response_agent.error = { response: { error: "#{handler_class_name}: #{e.message}\n#{e.backtrace.join("\n")}" }}
25
+ response_agent.error = { error: { handler_class_name => "#{e.message}\n#{e.backtrace.join("\n")}" }}
26
26
  end
27
27
  end
28
28
  end
@@ -34,20 +34,22 @@ module Isomorfeus
34
34
  end
35
35
  Thread.current[:isomorfeus_user] = user
36
36
  request_hash = Oj.load(data, mode: :strict)
37
- unless request_hash.key?(:iso_ping)
37
+ unless request_hash.key?("iso_ping")
38
38
  handler_instance_cache = {}
39
39
  response_agent_array = []
40
40
  Thread.current[:isomorfeus_pub_sub_client] = client
41
41
  process_request(request_hash, handler_instance_cache, response_agent_array)
42
- handler_instance_cache.each_value do |handler|
43
- handler.resolve if handler.resolving?
44
- end
42
+ # handler_instance_cache.each_value do |handler|
43
+ # handler.resolve if handler.resolving?
44
+ # end
45
45
  result = {}
46
46
  response_agent_array.each do |response_agent|
47
47
  result.deep_merge!(response_agent.result)
48
48
  end
49
49
  client.write Oj.dump(result, mode: :strict) unless result.empty?
50
50
  end
51
+ rescue => e
52
+ STDERR.puts "#{e.message}#{e.backtrace&.join("\n")}"
51
53
  ensure
52
54
  Thread.current[:isomorfeus_user] = nil
53
55
  Thread.current[:isomorfeus_pub_sub_client] = nil
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  module Transport
3
- VERSION = '23.6.0.rc4'
3
+ VERSION = '23.6.0.rc5'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-transport
3
3
  version: !ruby/object:Gem::Version
4
- version: 23.6.0.rc4
4
+ version: 23.6.0.rc5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-19 00:00:00.000000000 Z
11
+ date: 2023-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -190,14 +190,14 @@ dependencies:
190
190
  requirements:
191
191
  - - '='
192
192
  - !ruby/object:Gem::Version
193
- version: 23.6.0.rc4
193
+ version: 23.6.0.rc5
194
194
  type: :development
195
195
  prerelease: false
196
196
  version_requirements: !ruby/object:Gem::Requirement
197
197
  requirements:
198
198
  - - '='
199
199
  - !ruby/object:Gem::Version
200
- version: 23.6.0.rc4
200
+ version: 23.6.0.rc5
201
201
  - !ruby/object:Gem::Dependency
202
202
  name: rake
203
203
  requirement: !ruby/object:Gem::Requirement