flok 0.0.68 → 0.0.69
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/app/drivers/CHROME/src/persist.js +4 -0
- data/lib/flok/version.rb +1 -1
- data/spec/kern/assets/vm/controller8ws.rb +5 -1
- data/spec/kern/vm_service_spec.rb +44 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 287f1f518fcf5f7c25b591d19c81246499091a07
|
|
4
|
+
data.tar.gz: 027fc95d97fd69b2765f4159709a46d3c7bc7282
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d09bc22ecf0daf4d829e9e7ad297cfabdb47cd44d9ef591801d0e534eeee2c3168ca4c207cd135ea9960fa2706cd88e34922943ba3d793ee14d2f11c7b4c09a3
|
|
7
|
+
data.tar.gz: 9782cd1e8bd0b95b01e803d1f96ac35046ff7f64f7163a34dca09664316562ce377ee27660ec19dcced1c239e2687e2a981b26bcaab415df24e43d19b751cfcb
|
|
@@ -16,5 +16,9 @@ function if_per_del_ns(ns) {
|
|
|
16
16
|
function if_per_get(s, ns, key) {
|
|
17
17
|
var _ns = store.namespace(ns);
|
|
18
18
|
var res = _ns.get(key);
|
|
19
|
+
if (res === undefined) {
|
|
20
|
+
throw "This should never be reached. if_per_get returned undefined, it should return null";
|
|
21
|
+
}
|
|
22
|
+
|
|
19
23
|
int_dispatch([4, "int_per_get_res", s, ns, key, res]);
|
|
20
24
|
}
|
data/lib/flok/version.rb
CHANGED
|
@@ -2,6 +2,10 @@ controller :my_controller do
|
|
|
2
2
|
spots "content"
|
|
3
3
|
services :vm
|
|
4
4
|
|
|
5
|
+
on_entry %{
|
|
6
|
+
read_res_params = [];
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
action :my_action do
|
|
6
10
|
on_entry %{
|
|
7
11
|
page0 = {
|
|
@@ -14,7 +18,7 @@ controller :my_controller do
|
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
on "read_res", %{
|
|
17
|
-
read_res_params
|
|
21
|
+
read_res_params.push(params);
|
|
18
22
|
}
|
|
19
23
|
end
|
|
20
24
|
end
|
|
@@ -971,7 +971,7 @@ RSpec.describe "kern:vm_service" do
|
|
|
971
971
|
@driver.int "int_per_get_res", ["vm", "spec", "my_key", nil]
|
|
972
972
|
|
|
973
973
|
read_res_params = ctx.dump "read_res_params"
|
|
974
|
-
expect(read_res_params).to eq({})
|
|
974
|
+
expect(read_res_params).to eq([{}])
|
|
975
975
|
end
|
|
976
976
|
|
|
977
977
|
it "A watch request with the sync flag enabled does not send two read_res back after int_dispatch" do
|
|
@@ -990,8 +990,50 @@ RSpec.describe "kern:vm_service" do
|
|
|
990
990
|
#Send back a blank page
|
|
991
991
|
@driver.int "int_per_get_res", ["vm", "spec", "my_key", nil]
|
|
992
992
|
|
|
993
|
+
#Dispatch any pending async
|
|
994
|
+
#should not do anything here
|
|
995
|
+
@ctx.eval %{
|
|
996
|
+
for (var i = 0; i < 100; ++i) {
|
|
997
|
+
int_dispatch([]);
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
|
|
993
1001
|
read_res_params = ctx.dump "read_res_params"
|
|
994
|
-
expect(read_res_params).to eq({})
|
|
1002
|
+
expect(read_res_params).to eq([{}])
|
|
1003
|
+
end
|
|
1004
|
+
|
|
1005
|
+
it "A watch request with the sync flag enabled does return the page to read_res" do
|
|
1006
|
+
ctx = flok_new_user File.read('./spec/kern/assets/vm/controller8ws.rb'), File.read("./spec/kern/assets/vm/config4.rb")
|
|
1007
|
+
|
|
1008
|
+
ctx.eval %{
|
|
1009
|
+
base = _embed("my_controller", 1, {}, null);
|
|
1010
|
+
|
|
1011
|
+
//Drain queue
|
|
1012
|
+
int_dispatch([]);
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
@driver.ignore_up_to "if_per_get", 0
|
|
1016
|
+
@driver.mexpect("if_per_get", ["vm", "spec", "my_key"], 0)
|
|
1017
|
+
|
|
1018
|
+
#Send back a real page
|
|
1019
|
+
@driver.int "int_per_get_res", ["vm", "spec", "my_key", {
|
|
1020
|
+
"_id" => "my_key",
|
|
1021
|
+
"entries" => [],
|
|
1022
|
+
"_head" => nil,
|
|
1023
|
+
"_next" => nil
|
|
1024
|
+
}]
|
|
1025
|
+
|
|
1026
|
+
#Dispatch any pending async
|
|
1027
|
+
#should not do anything here
|
|
1028
|
+
@ctx.eval %{
|
|
1029
|
+
for (var i = 0; i < 100; ++i) {
|
|
1030
|
+
int_dispatch([]);
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
read_res_params = ctx.dump "read_res_params"
|
|
1035
|
+
expect(read_res_params[0]["_id"]).to eq("my_key")
|
|
1036
|
+
expect(read_res_params.length).to eq(1)
|
|
995
1037
|
end
|
|
996
1038
|
|
|
997
1039
|
it "Clears the dirty page when pageout runs" do
|