architect 0.0.2 → 0.0.3

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: daa8aa8ac05c622ddde6c3d2ede4dec0600a655c
4
- data.tar.gz: aad21f214942aac852900fef7bf51ccbd740652a
3
+ metadata.gz: 233edbf05b66746772b272c2081ffd5191aeea92
4
+ data.tar.gz: c62ee559568eb7cec889454e611447fafc014d41
5
5
  SHA512:
6
- metadata.gz: c77723dd253c39a2249168eff0a57a0672ff08c9edf50f319d89f1b8e2478fd64f4b55c99570c2ee1347c76f94f9a4829d95648c62226ad32fbe5f41b4c1c662
7
- data.tar.gz: 367cb3d57759dd32c63f98960e1935abb6e0981c98545689de99bb4748d6b517220e1cfee2e68af8bd07de616931d076d48e6fe55b286751406fab402ce72222
6
+ metadata.gz: aff80886300d41b21350d06a39ce54f6f2759d0a57a53cd2e53acd1c049e619fdbb2046e17b02f9c76af837bef35dbd760ecf863f454134e7c861cb05d073ebf
7
+ data.tar.gz: 80dc166055e6c3477ee2437751213b42857f876965db89c6473386699e75f0613adeec57840df73abe826f7c9148582135fef256db50371eac36286bc9c14069
data/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ ## [v0.0.3](https://github.com/EtienneLem/architect/tree/v0.0.3)
2
+ - Fix long-lived workers callback bug
3
+
4
+ ## [v0.0.2](https://github.com/EtienneLem/architect/tree/v0.0.2)
5
+ - Long-lived workers
6
+
7
+ ## [v0.0.1](https://github.com/EtienneLem/architect/tree/v0.0.1)
8
+ Initial release
9
+ - Short-lived workers
@@ -12,6 +12,7 @@ class @Architect.Worker
12
12
 
13
13
  return unless data = @callbacksQueue[type]
14
14
  delete @callbacksQueue[type]
15
+
15
16
  this.dispatch(type, data)
16
17
 
17
18
  dispatch: (type, data) ->
@@ -27,15 +27,15 @@ spawnWorker = (type) ->
27
27
 
28
28
  # Long-lived workers
29
29
  jobs = {}
30
- @Architect.workOn = (jobName, data, type, callback) ->
30
+ @Architect.workOn = (jobName, data, type, @workOnCallback) ->
31
31
  alreadySpawned = !!jobs[jobName]
32
32
 
33
33
  worker = jobs[jobName] ||= spawnWorker(type)
34
34
  worker.postMessage(data)
35
35
 
36
36
  return if alreadySpawned
37
- worker.addEventListener 'message', (e) ->
38
- callback(e.data)
37
+ worker.addEventListener 'message', (e) =>
38
+ @workOnCallback(e.data)
39
39
 
40
40
  @Architect.endJob = (jobName) ->
41
41
  return unless worker = jobs[jobName]
@@ -1,3 +1,3 @@
1
1
  module Architect
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: architect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Etienne Lemay
@@ -95,6 +95,7 @@ files:
95
95
  - Rakefile
96
96
  - MIT-LICENSE
97
97
  - README.md
98
+ - CHANGELOG.md
98
99
  homepage: https://github.com/EtienneLem/architect
99
100
  licenses:
100
101
  - MIT