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.
- checksums.yaml +4 -4
- data/lib/event-framework.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5adb17a1332a1ccccc63ed51659bef8db4fea50d
|
4
|
+
data.tar.gz: ad865e4a58c26a3808d5a324bdb1699ddc8cd18b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0871787ee6c1b2ec7ceee997c02960023a27f5892963f48f56c6f02d06c113c70425cdc4257341f17112134436e706e94653e1cce0e96386a44d5f3a7b9de0c
|
7
|
+
data.tar.gz: 74104b04327d881a4a08479ca1b14f8437477dab45b1e5380325bca8def42e73f34dbc3c2b929dd1d3b8564bb9674b0fe9217dfc72045d9ce78304a99f2f42c4
|
data/lib/event-framework.rb
CHANGED
@@ -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.
|
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-
|
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
|