flok 0.0.90 → 0.0.91

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4a76623395df32a9d7635562ae9c63134e96a887
4
- data.tar.gz: d25f7e7fe8f2296f64c99f3ac97246ea3f67a05b
3
+ metadata.gz: f8999bb72a38c7114795417ffc009488e7bb13cc
4
+ data.tar.gz: db06b5976e038acff22a49766f20734eab5f6710
5
5
  SHA512:
6
- metadata.gz: c08d02e900e07ff0d474a52d061920f2689871aa6066b0037716964cb9caa0d0826fb335867c94f29f4a6a0b56c399364d868b0f5c7dae49d84ff665d40ffe89
7
- data.tar.gz: 3c56aa8429761f5fcfc0aa152064124c89939b712a8e8644d2a1cb84842193bef5045ff050d93762d8257b49190c8d6d126e5f4bd5b824ef8ecedd5d551f47ee
6
+ metadata.gz: f0ddfea3bae416b8bba31cb82ea9a1a9f56e3e3cb2146c508fcefcb98bdebae274b9d97081f5a135bdc2478c07cc68a19c3e313cf81ea5ade9a47c2be16d1993
7
+ data.tar.gz: 0221baaa0c957ea2e19ba9f7a4763616f0fb5f7c0601a4ab273d699326915afa151571f854d9bbfddf281d3d09b4e9d8dd223a7d0307626db06c3ed17a5a2c42
@@ -61,7 +61,17 @@ service :vm do
61
61
 
62
62
  //Map that holds all controllers synchronously sent (used to avoid sending
63
63
  //those controllers that are also on vm_notify_map a second message)
64
- var sync_sent_map = {};
64
+ var sync_sent_map = {};
65
+
66
+ //You *cannot* int_event in the middle of this function, it must be deferred
67
+ //to the end of the function as all the code here is critical. int_event will
68
+ //synchronously execute and can cause side effects if say the int_event causes
69
+ //a controller to be embedded which then watches a page, it will get hit in the
70
+ //block that looks for a vm_notify_map (which it is now apart of)
71
+ var sync_read_res_waiting = [];
72
+
73
+ //Notify all controllers that requested to be notified synchronously
74
+ //typically via watch(sync:)
65
75
  if (sync_waiting_controllers !== undefined) {
66
76
  for (var i = 0; i < sync_waiting_controllers.length; ++i) {
67
77
  var c = sync_waiting_controllers[i];
@@ -71,7 +81,7 @@ service :vm do
71
81
  sync_sent_map[c] = true;
72
82
 
73
83
  //Notify controller synchronously
74
- int_event(c, "read_res", page);
84
+ sync_read_res_waiting.push(c);
75
85
  }
76
86
  }
77
87
 
@@ -90,6 +100,11 @@ service :vm do
90
100
 
91
101
  //Clear the sync_waiting_controllers
92
102
  delete vm_cache_write_sync_pending[page._id];
103
+
104
+ //Now execute the synthronous int_events
105
+ for (var i = 0; i < sync_read_res_waiting.length; ++i) {
106
+ sync_read_res_waiting(sync_read_res_waiting[i], "read_res", page);
107
+ }
93
108
  }
94
109
 
95
110
  function vm_pageout() {
@@ -1,3 +1,3 @@
1
1
  module Flok
2
- VERSION = "0.0.90"
2
+ VERSION = "0.0.91"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flok
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.90
4
+ version: 0.0.91
5
5
  platform: ruby
6
6
  authors:
7
7
  - seo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-19 00:00:00.000000000 Z
11
+ date: 2015-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs