flok 0.0.69 → 0.0.70
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/kern/services/vm.rb +3 -4
- data/lib/flok/version.rb +1 -1
- data/spec/kern/vm_service_spec.rb +34 -0
- 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: 0c9f261a2ac31edfd21f064be57fb220825ab161
         | 
| 4 | 
            +
              data.tar.gz: 8772a24eeee08c527703bd1a512bb64b73885521
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 7e192dd155ce89611416bc62c2cc375641232c0f1fb6d5b67a9e3c40c9da14e35ec38af950ce9c9b8e9054c52d5a4d7082294eb50ee9ff2642a0115826df8402
         | 
| 7 | 
            +
              data.tar.gz: 3c2b238399f9c9148980f55f2b345e9c88b3a42295c16257daf87eaf0d6f0bd27bc6187eebd9c94cecd0a2e8b876e73cbdaf9d1ddf05a57a9f21c2830efa5e1b
         | 
    
        data/app/kern/services/vm.rb
    CHANGED
    
    | @@ -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 |  | 
    
        data/lib/flok/version.rb
    CHANGED
    
    
| @@ -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 |  |