event-framework 1.0.3 → 1.0.4

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/event-framework.rb +10 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1484ad798f53a8683a7e47cb78398c080eea7273
4
- data.tar.gz: 411780eb1042b81f424af036416e2148f379844e
3
+ metadata.gz: 5adb17a1332a1ccccc63ed51659bef8db4fea50d
4
+ data.tar.gz: ad865e4a58c26a3808d5a324bdb1699ddc8cd18b
5
5
  SHA512:
6
- metadata.gz: 836bbd28b7a85b04a15a830431318e6107875b8c47d68813bec08ffde665849bd3a394120619974d83f30eddaef6c5b21fbd68518e79522dc4909505125ff0ed
7
- data.tar.gz: ba5323fc9dc6a2112502802e283ca45833c30b3c80092c331e74d7be9bb4bb43bd83e6355087d8dd47ce2299e1c57a329285f56ee4e0a251d1bd6cc7c81c61f8
6
+ metadata.gz: e0871787ee6c1b2ec7ceee997c02960023a27f5892963f48f56c6f02d06c113c70425cdc4257341f17112134436e706e94653e1cce0e96386a44d5f3a7b9de0c
7
+ data.tar.gz: 74104b04327d881a4a08479ca1b14f8437477dab45b1e5380325bca8def42e73f34dbc3c2b929dd1d3b8564bb9674b0fe9217dfc72045d9ce78304a99f2f42c4
@@ -41,6 +41,7 @@
41
41
  #
42
42
  # * EF::Object should be included after initialize
43
43
  # * Callbacks will be executed in threads of subscribers (where they were defined)
44
+ # * In the example the handler will be called in the main thread, <br> but if you define the client in the thread where you bind it to the server's event, <br> then the handler will be called in the same thread
44
45
  module EF
45
46
  ##
46
47
  # === provides threads with separated event loops
@@ -205,6 +206,15 @@ module EF
205
206
  stop_listening self, event, block
206
207
  end
207
208
 
209
+ ##
210
+ # by default handlers will be executed in the thread where the receiver was defined <br>
211
+ # the method changes it so that handlers will be executed in the passed thread
212
+ def move_to(thread)
213
+ @mutex.synchronize do
214
+ @thread = thread
215
+ end
216
+ end
217
+
208
218
  protected
209
219
 
210
220
  ##
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: event-framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Speransky Danil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-04 00:00:00.000000000 Z
11
+ date: 2014-03-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Event Framework is a minimalistic library providing publish–subscribe
14
14
  pattern