tdlib-ruby 0.9.3 → 0.9.4

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
  SHA1:
3
- metadata.gz: 2ea47ef95a69ccc2fb0ae4afbead9e2ac1470e00
4
- data.tar.gz: 79edb08342b7faf196eed3b835577e50ac60a4cc
3
+ metadata.gz: 81084785487847d98d74b1a27857235c9094031a
4
+ data.tar.gz: 665dc58fe58969ddc4f1cd1ccb23f4d03c543192
5
5
  SHA512:
6
- metadata.gz: 349c0798e5b74134458564fa1303bc93de4ceb23ffdbef04ddc54f23cb9904daa1dbaa33b37dba592d39170ed330e9940c11f4f58c9a5b1ffe524595c457526e
7
- data.tar.gz: 67baf114ec3b605e1430ce611bf0c5246d575267108eb3f215494a838eeab4457d99b1b800c89ed643a260945e6b7eb880f9394690e3801949782327c82375b2
6
+ metadata.gz: dcf903551729e52eba8c6772b8bde87e9ffb350026ca9200c3fb67196f1a41a462ea6d15bf95e2d6b525d57c76e6cb481ef61669c240a6782bc9d792dcaf5bf3
7
+ data.tar.gz: 8b704d60ef867628888dfaa87c3197cb81a4aad17155367df9545bac180ca724be821101ddd6b2534bc0dfc847cd0032e44a0f7b577c252fab500b642a2155b4
@@ -1,3 +1,7 @@
1
+ ### 0.9.4 / 2018-05-16
2
+
3
+ * Fix recursive locking in nested handlers
4
+
1
5
  ### 0.9.3 / 2018-05-04
2
6
 
3
7
  * Add proxy support
@@ -37,8 +37,7 @@ class TD::UpdateManager
37
37
 
38
38
  def handle_update
39
39
  update = TD::Api.client_receive(@td_client, TIMEOUT)
40
- @mutex.synchronize do
41
- @handlers.each { |h| h.call(update) } unless update.nil?
42
- end
40
+ @mutex.synchronize { handlers = @handlers.dup }
41
+ handlers.each { |h| h.call(update) } unless update.nil?
43
42
  end
44
43
  end
@@ -1,4 +1,4 @@
1
1
  module TD
2
2
  # tdlib-ruby version
3
- VERSION = "0.9.3"
3
+ VERSION = "0.9.4"
4
4
  end
@@ -74,4 +74,19 @@ describe TD::Client do
74
74
  expect(@result).to include('@type', 'entities')
75
75
  end
76
76
  end
77
+
78
+ describe 'nested handlers' do
79
+ before { Thread.abort_on_exception = true }
80
+
81
+ subject do
82
+ client.on_ready do
83
+ client.broadcast(payload) do
84
+ client.broadcast_and_receive(payload)
85
+ end
86
+ sleep 1
87
+ end
88
+ end
89
+
90
+ it { expect { subject }.not_to raise_error(Exception) }
91
+ end
77
92
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tdlib-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Southbridge
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-04 00:00:00.000000000 Z
11
+ date: 2018-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable