flok 0.0.69 → 0.0.70

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: 287f1f518fcf5f7c25b591d19c81246499091a07
4
- data.tar.gz: 027fc95d97fd69b2765f4159709a46d3c7bc7282
3
+ metadata.gz: 0c9f261a2ac31edfd21f064be57fb220825ab161
4
+ data.tar.gz: 8772a24eeee08c527703bd1a512bb64b73885521
5
5
  SHA512:
6
- metadata.gz: d09bc22ecf0daf4d829e9e7ad297cfabdb47cd44d9ef591801d0e534eeee2c3168ca4c207cd135ea9960fa2706cd88e34922943ba3d793ee14d2f11c7b4c09a3
7
- data.tar.gz: 9782cd1e8bd0b95b01e803d1f96ac35046ff7f64f7163a34dca09664316562ce377ee27660ec19dcced1c239e2687e2a981b26bcaab415df24e43d19b751cfcb
6
+ metadata.gz: 7e192dd155ce89611416bc62c2cc375641232c0f1fb6d5b67a9e3c40c9da14e35ec38af950ce9c9b8e9054c52d5a4d7082294eb50ee9ff2642a0115826df8402
7
+ data.tar.gz: 3c2b238399f9c9148980f55f2b345e9c88b3a42295c16257daf87eaf0d6f0bd27bc6187eebd9c94cecd0a2e8b876e73cbdaf9d1ddf05a57a9f21c2830efa5e1b
@@ -52,11 +52,10 @@ service :vm do
52
52
  //List of controllers to notify synchronously
53
53
  var sync_waiting_controllers = vm_cache_write_sync_pending[page._id];
54
54
 
55
+ //Map that holds all controllers synchronously sent (used to avoid sending
56
+ //those controllers that are also on vm_notify_map a second message)
57
+ var sync_sent_map = {};
55
58
  if (sync_waiting_controllers !== undefined) {
56
- //Map that holds all controllers synchronously sent (used to avoid sending
57
- //those controllers that are also on vm_notify_map a second message)
58
- var sync_sent_map = {};
59
-
60
59
  for (var i = 0; i < sync_waiting_controllers.length; ++i) {
61
60
  var c = sync_waiting_controllers[i];
62
61
 
@@ -1,3 +1,3 @@
1
1
  module Flok
2
- VERSION = "0.0.69"
2
+ VERSION = "0.0.70"
3
3
  end
@@ -1036,6 +1036,40 @@ RSpec.describe "kern:vm_service" do
1036
1036
  expect(read_res_params.length).to eq(1)
1037
1037
  end
1038
1038
 
1039
+ it "A watch request with the sync flag enabled does return the page to read_res followed by all future changes being sent asynchronously" do
1040
+ ctx = flok_new_user File.read('./spec/kern/assets/vm/controller8ws.rb'), File.read("./spec/kern/assets/vm/config4.rb")
1041
+
1042
+ ctx.eval %{
1043
+ base = _embed("my_controller", 1, {}, null);
1044
+
1045
+ //Drain queue
1046
+ int_dispatch([]);
1047
+ }
1048
+
1049
+ @driver.ignore_up_to "if_per_get", 0
1050
+ @driver.mexpect("if_per_get", ["vm", "spec", "my_key"], 0)
1051
+
1052
+ #Send back a real page
1053
+ @driver.int "int_per_get_res", ["vm", "spec", "my_key", {
1054
+ "_id" => "my_key",
1055
+ "entries" => [],
1056
+ "_head" => nil,
1057
+ "_next" => nil
1058
+ }]
1059
+
1060
+ #Dispatch any pending async
1061
+ #should not do anything here
1062
+ @ctx.eval %{
1063
+ for (var i = 0; i < 100; ++i) {
1064
+ int_dispatch([]);
1065
+ }
1066
+ }
1067
+
1068
+ read_res_params = ctx.dump "read_res_params"
1069
+ expect(read_res_params[0]["_id"]).to eq("my_key")
1070
+ expect(read_res_params.length).to eq(1)
1071
+ end
1072
+
1039
1073
  it "Clears the dirty page when pageout runs" do
1040
1074
  ctx = flok_new_user File.read('./spec/kern/assets/vm/controller18.rb'), File.read("./spec/kern/assets/vm/config4.rb")
1041
1075
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flok
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.69
4
+ version: 0.0.70
5
5
  platform: ruby
6
6
  authors:
7
7
  - seo