flok 0.0.71 → 0.0.72

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: 3a7905b48da7599f5f6f62357affb30856c22cf7
4
- data.tar.gz: 340d2d3ddf2cf4d564959a0b9d553dd9fb6eb7f2
3
+ metadata.gz: d06f92c68324984f4e293390562ef487283971fd
4
+ data.tar.gz: 40c7e7f381e3a6630c1bac4935ce0c660adb183b
5
5
  SHA512:
6
- metadata.gz: 48ac928647f77627085badb6eb35d7b419e4bd523b9772a146476a95f6cd4571f723cd986d105643b79d4c12d2b5c1fa62c09c186bc5a3288f5402c8d5d5b682
7
- data.tar.gz: ba8832ae43f3fa6855036ce0a273041826d7eb30db5ebd843472190da32df5db0537072487d9fbe9f1489325de891254aff6c2faf119fc54664256b44081fdc6
6
+ metadata.gz: a15900ee9f4ef22c576c48ab195f1669495450e211ec2b2c8791cc845fca3208e30513b08cb8878064ef75eaca787f34c6c8c621040b2824c65a494ce8da663e
7
+ data.tar.gz: 45edc71adc819e2d0b994e7ee746aa6d4da654b57fbcd5e5bbcdbd49cd3731303342a885a5df5781aa91473878089b8f43b4d65a8a02fc9f4591585ca65a3e97
@@ -28,7 +28,7 @@
28
28
  pg_sockio<%= i %>_bp = tels(1);
29
29
  reg_evt(pg_sockio<%= i %>_bp, pg_sockio<%= i %>_xevent_handler);
30
30
 
31
- SEND("net", "if_sockio_init", options.url, pg_sockio<%= i %>_bp);
31
+ SEND("main", "if_sockio_init", options.url, pg_sockio<%= i %>_bp);
32
32
 
33
33
  //Signal that the socket.io driver should forward all events to the socket defined by pg_sockio{N}_bp
34
34
  //to the endpoint (with the same reference)
@@ -487,7 +487,6 @@ service :vm do
487
487
  vm_did_wakeup = true;
488
488
  <% end %>
489
489
 
490
-
491
490
  //Call init functions
492
491
  <% @options[:pagers].each do |p| %>
493
492
  <%= p[:name] %>_init("<%= p[:namespace] %>", <%= (p[:options] || {}).to_json %>);
@@ -1,7 +1,8 @@
1
1
  #Socket.io (sockio.js)
2
2
 
3
3
  ##Driver Functions
4
- `if_sockio_init(url, sp)` - Initialize a socketio socket with the given `url` and refer to it with `sp`.
4
+ `if_sockio_init(url, sp)` - Initialize a socketio socket with the given `url` and refer to it with `sp`. Any messages received relating to this
5
+ socket, like `if_sockio_fwd` or `if_sockio_send` should be queued if the socket is not instantly created and dispatched when the socket is created.
5
6
 
6
7
  `if_sockio_fwd(sp, event_name, ep)` - A request to forward messages from a socket.io socket that represents `id` to the `ep` address as an `if_event` where the event
7
8
  name is the same as the `socket.io` `event_name` and the information is passed as the `event` field for the `if_event`. Only forward messages matching
@@ -1,3 +1,3 @@
1
1
  module Flok
2
- VERSION = "0.0.71"
2
+ VERSION = "0.0.72"
3
3
  end
@@ -41,7 +41,7 @@ RSpec.describe "kern:sockio_pager" do
41
41
 
42
42
  it "Does initialize a socketio connection" do
43
43
  ctx = flok_new_user File.read('./spec/kern/assets/vm/pg_sockio/nothing.rb'), File.read("./spec/kern/assets/vm/pg_sockio/config.rb")
44
- ctx.evald %{
44
+ dump = ctx.evald %{
45
45
  //Call embed on main root view
46
46
  dump.base = _embed("my_controller", 0, {}, null);
47
47
 
@@ -52,8 +52,8 @@ RSpec.describe "kern:sockio_pager" do
52
52
  }
53
53
 
54
54
  #URL is specified in the config
55
- @driver.ignore_up_to "if_sockio_init", 1
56
- @driver.mexpect "if_sockio_init", ["http://localhost", Integer], 1
55
+ @driver.ignore_up_to "if_sockio_init", 0
56
+ @driver.mexpect "if_sockio_init", ["http://localhost", Integer], 0
57
57
 
58
58
  #Forward the update event
59
59
  @driver.ignore_up_to "if_sockio_fwd", 1
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.71
4
+ version: 0.0.72
5
5
  platform: ruby
6
6
  authors:
7
7
  - seo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-21 00:00:00.000000000 Z
11
+ date: 2015-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs
@@ -299,7 +299,6 @@ files:
299
299
  - app/kern/pagers/pg_net_sim.js
300
300
  - app/kern/pagers/pg_sockio.js
301
301
  - app/kern/pagers/pg_spec.js
302
- - app/kern/pagers/sockio_pager.js
303
302
  - app/kern/pagers/spec0.js
304
303
  - app/kern/pagers/spec1.js
305
304
  - app/kern/pagers/spec2.js
@@ -1,66 +0,0 @@
1
- <% if @defines['sockio_pager'] %>
2
- sockio_pager_data = {};
3
-
4
- sockio_pager_sp = null;
5
- sockio_pager_bp = null;
6
- waiting_bp = null;
7
- function sockio_pager_init(options) {
8
- sockio_pager_sp = tels(1);
9
- sockio_pager_bp = tels(1);
10
- SEND("main", "if_sockio_init", options.url, sockio_pager_sp);
11
- reg_evt(sockio_pager_bp, sockio_pager_sp_endpoint);
12
- SEND("async", "if_sockio_fwd", sockio_pager_sp, "read_res", sockio_pager_bp);
13
- SEND("async", "if_sockio_fwd", sockio_pager_sp, "notify", sockio_pager_bp);
14
- }
15
-
16
- function sockio_pager_read_sync(ns, bp, key) {
17
- throw "sockio_pager does not support read_sync"
18
- }
19
-
20
- function sockio_pager_read(ns, bp, key) {
21
- var info = {
22
- key: key,
23
- bp: bp
24
- }
25
-
26
- SEND("async", "if_sockio_send", sockio_pager_sp, "read", info);
27
-
28
- waiting_bp = bp;
29
- }
30
-
31
- function sockio_pager_write(key, value) {
32
- throw "sockio_pager does not support write"
33
- }
34
-
35
- //Where socket.io data comes in
36
- function sockio_pager_sp_endpoint(ep, ename, info) {
37
- if (ename === "read_res") {
38
- var bp = info.bp;
39
- var key = info.key;
40
- var value = info.value;
41
- int_event(waiting_bp, "read_res", info);
42
- vm_cache_write("net", key, value);
43
- } else if (ename === "notify") {
44
- var key = info.key;
45
- vm_notify("net", key);
46
- }
47
- }
48
-
49
- function sockio_pager_watch(ns, key) {
50
- var info = {
51
- ns: ns,
52
- key: key
53
- }
54
- SEND("async", "if_sockio_send", sockio_pager_sp, "watch", info);
55
- }
56
-
57
- function sockio_pager_unwatch(ns, key) {
58
- var info = {
59
- ns: ns,
60
- key: key
61
- }
62
- SEND("async", "if_sockio_send", sockio_pager_sp, "unwatch", info);
63
- }
64
-
65
-
66
- <% end %>