entangld 2.2.0 → 2.3.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "entangld",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Synchronized key-value stores with RPCs and events",
5
5
  "main": "index.js",
6
6
  "jshintConfig": {
@@ -12,9 +12,9 @@
12
12
  "test": "mocha",
13
13
  "lint:js": "jshint --reporter=node_modules/jshint-stylish index.js test/",
14
14
  "build": "npm run lint:js -s && npm run test -s && npm run docs -s",
15
- "watch:lint:js": "nodemon -w index.js -w test/ -x npm run lint:js -s",
16
- "dev": "nodemon -w index.js -w test/ -x npm run build -s",
17
- "docs": "node generate_docs.js"
15
+ "docs": "node generate_docs.js",
16
+ "lint": "npx eslint lib test index.js || true",
17
+ "lint:fix": "npx eslint --fix lib test index.js || true"
18
18
  },
19
19
  "repository": {
20
20
  "type": "git",
@@ -22,16 +22,15 @@
22
22
  },
23
23
  "author": "c0d3",
24
24
  "contributors": [
25
- "Wilkins White <wilkins.white@daxbot.com>",
26
- "Jonathan Van Schenck <jon.vanschenck@daxbot.com>"
25
+ "Wilkins White <ww@novadynamics.com>",
26
+ "Jonathan Van Schenck <jvschenck@novadynamics.com>"
27
27
  ],
28
28
  "license": "MIT",
29
29
  "homepage": "https://daxbot.com/open-source",
30
30
  "devDependencies": {
31
- "fs-then-native": "^2.0.0",
31
+ "eslint": "^8.35.0",
32
+ "eslint-plugin-node": "^11.1.0",
32
33
  "jsdoc-to-markdown": "^7.1.1",
33
- "jshint": "^2.13.1",
34
- "jshint-stylish": "^2.2.1",
35
34
  "mocha": "^10.0.0",
36
35
  "nodemon": "^2.0.16",
37
36
  "sockhop": "^1.4.3"
package/tags ADDED
@@ -0,0 +1,244 @@
1
+ !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
2
+ !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
3
+ !_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
4
+ !_TAG_PROGRAM_NAME Exuberant Ctags //
5
+ !_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
6
+ !_TAG_PROGRAM_VERSION 5.9~svn20110310 //
7
+ DEBUG_ERROR libraries/unix/samples/debug.h 27;" d line:27 language:C++
8
+ DEBUG_H_ libraries/unix/samples/debug.h 9;" d line:9 language:C++
9
+ DEBUG_INFO libraries/unix/samples/debug.h 39;" d line:39 language:C++
10
+ DEBUG_LEVEL_ERROR libraries/unix/samples/debug.h 15;" d line:15 language:C++
11
+ DEBUG_LEVEL_INFO libraries/unix/samples/debug.h 17;" d line:17 language:C++
12
+ DEBUG_LEVEL_VERBOSE libraries/unix/samples/debug.h 18;" d line:18 language:C++
13
+ DEBUG_LEVEL_WARN libraries/unix/samples/debug.h 16;" d line:16 language:C++
14
+ DEBUG_VERBOSE libraries/unix/samples/debug.h 45;" d line:45 language:C++
15
+ DEBUG_WARN libraries/unix/samples/debug.h 33;" d line:33 language:C++
16
+ DEFAULT_HOST libraries/unix/samples/client.cpp /^constexpr char DEFAULT_HOST[] = "127.0.0.1"; \/**< Default host address. *\/$/;" v line:17 language:C++
17
+ DEFAULT_PORT libraries/unix/samples/client.cpp /^constexpr int DEFAULT_PORT = 50001; \/**< Default host port. *\/$/;" v line:18 language:C++
18
+ DEFAULT_PORT libraries/unix/samples/server.cpp /^constexpr int DEFAULT_PORT = 50001;$/;" v line:18 language:C++
19
+ DEFAULT_TIMEOUT libraries/unix/samples/client.cpp /^constexpr int DEFAULT_TIMEOUT = 2000; \/**< Default timeout. *\/$/;" v line:19 language:C++
20
+ Datastore libraries/unix/include/Datastore.h /^ explicit Datastore(const nlohmann::json &data = nlohmann::json::object())$/;" f line:28 language:C++ class:entangld::Datastore access:public signature:(const nlohmann::json &data = nlohmann::json::object())
21
+ Datastore libraries/unix/include/Datastore.h /^ class Datastore {$/;" c line:22 language:C++ namespace:entangld
22
+ Entangld index.js /^class Entangld extends EventEmitter {$/;" C line:572 language:JavaScript
23
+ EntangldError index.js /^class EntangldError extends Error {$/;" C line:153 language:JavaScript
24
+ Entangld_Message index.js /^class Entangld_Message {$/;" C line:33 language:JavaScript
25
+ FIXME test/sockets.js /^\/\/ FIXME : comment out for debugging$/;" T line:9 language:JavaScript
26
+ Message libraries/unix/include/Message.h /^ class Message {$/;" c line:17 language:C++ namespace:entangld
27
+ Subscription index.js /^class Subscription {$/;" C line:166 language:JavaScript
28
+ TODO test/tests.js /^ \/\/ TODO: Add a triple multiplexed store test$/;" T line:588 language:JavaScript
29
+ VERSION libraries/unix/samples/server.cpp /^constexpr char VERSION[] = "1.0.0";$/;" v line:15 language:C++
30
+ _ENTANGLD_DATASTORE_H_ libraries/unix/include/Datastore.h 9;" d line:9 language:C++
31
+ _ENTANGLD_MESSAGE_H_ libraries/unix/include/Message.h 9;" d line:9 language:C++
32
+ _get_remote_object index.js /^ _get_remote_object(path) {$/;" M line:915 language:JavaScript
33
+ _has_cb index.js /^ this._has_cb = (typeof(callback) === "function");$/;" M line:189 language:JavaScript
34
+ _is_counting index.js /^ this._is_counting = (this.downstream === null);$/;" M line:190 language:JavaScript
35
+ _local_data index.js /^ this._local_data = {};$/;" P line:581 language:JavaScript
36
+ _requests index.js /^ this._requests = {};$/;" P line:582 language:JavaScript
37
+ _set_local index.js /^ _set_local(path, data, op_type="set", params={}) {$/;" M line:1276 language:JavaScript
38
+ _subscribe index.js /^ _subscribe(path, func, upstream = null, uuid = null, every = null) {$/;" M line:1090 language:JavaScript
39
+ _transmit index.js /^ this._transmit = () => { };$/;" M line:580 language:JavaScript
40
+ _unsubscribe index.js /^ _unsubscribe(subscriptions) {$/;" M line:1240 language:JavaScript
41
+ a test/tests.js /^ a: {$/;" P line:13 language:JavaScript
42
+ a test/tests.js /^ a: {$/;" P line:243 language:JavaScript
43
+ address test/sockets.js /^ address : "localhost",$/;" P line:129 language:JavaScript
44
+ address test/sockets.js /^ address : "localhost",$/;" P line:20 language:JavaScript
45
+ address test/sockets.js /^ address : "localhost",$/;" P line:25 language:JavaScript
46
+ afterEach test/circular.js /^ afterEach(function() {$/;" M line:25 language:JavaScript
47
+ afterEach test/sockets.js /^ afterEach(function() {$/;" M line:48 language:JavaScript
48
+ afterEach test/subscriptions.js /^ afterEach(function() {$/;" M line:21 language:JavaScript
49
+ attach index.js /^ attach(namespace, obj) {$/;" M line:642 language:JavaScript
50
+ attach libraries/unix/src/Datastore.cpp /^ void Datastore::attach($/;" f line:232 language:C++ class:entangld::Datastore signature:( std::string name, void (*handler)(const Message &msg, void *ctx), void *ctx)
51
+ b test/tests.js /^ b: {$/;" P line:14 language:JavaScript
52
+ b test/tests.js /^ b: {$/;" P line:244 language:JavaScript
53
+ beforeEach test/circular.js /^ beforeEach(function() {$/;" M line:10 language:JavaScript
54
+ beforeEach test/sockets.js /^ beforeEach(function() {$/;" M line:15 language:JavaScript
55
+ beforeEach test/subscriptions.js /^ beforeEach(function() {$/;" M line:7 language:JavaScript
56
+ c test/tests.js /^ c: 6$/;" P line:15 language:JavaScript
57
+ c test/tests.js /^ c: 6$/;" P line:245 language:JavaScript
58
+ c test/tests.js /^ c: {},$/;" P line:540 language:JavaScript
59
+ call index.js /^ call(...args) {$/;" M line:213 language:JavaScript
60
+ callback index.js /^ callback : func,$/;" P line:1109 language:JavaScript
61
+ callback libraries/unix/include/Datastore.h /^ void (*callback)(const Message &msg, void *ctx);$/;" m line:128 language:C++ struct:entangld::Datastore::__anon2 access:public
62
+ callback_ctx libraries/unix/include/Datastore.h /^ void *callback_ctx;$/;" m line:131 language:C++ struct:entangld::Datastore::__anon2 access:public
63
+ constructor index.js /^ constructor() {$/;" M line:574 language:JavaScript
64
+ constructor index.js /^ constructor(message) {$/;" M line:154 language:JavaScript
65
+ constructor index.js /^ constructor({path, uuid, callback, downstream, upstream, every}) {$/;" M line:183 language:JavaScript
66
+ constructor index.js /^ constructor({type, path, value, uuid, params, every}) {$/;" M line:35 language:JavaScript
67
+ d test/tests.js /^ d: {$/;" P line:18 language:JavaScript
68
+ d test/tests.js /^ d: {$/;" P line:248 language:JavaScript
69
+ debug_print libraries/unix/samples/debug.c /^void debug_print(int level, const char *file, int line, const char *format, ...)$/;" f line:27 language:C signature:(int level, const char *file, int line, const char *format, ...)
70
+ dereferenced_copy index.js /^function dereferenced_copy(original) {$/;" F line:388 language:JavaScript
71
+ describe test/circular.js /^describe("Circular References", function() {$/;" M line:7 language:JavaScript
72
+ describe test/sockets.js /^describe("Sockets", function() {$/;" M line:12 language:JavaScript
73
+ describe test/subscriptions.js /^describe("Subscription", function() {$/;" M line:4 language:JavaScript
74
+ detach index.js /^ detach(namespace, obj) {$/;" M line:687 language:JavaScript
75
+ detach libraries/unix/src/Datastore.cpp /^ void Datastore::detach(std::string name)$/;" f line:245 language:C++ class:entangld::Datastore signature:(std::string name)
76
+ downstream index.js /^ downstream : (this.downstream === null ? null : true),$/;" M line:366 language:JavaScript
77
+ downstream index.js /^ downstream : obj,$/;" P line:1106 language:JavaScript
78
+ e test/tests.js /^ e: [$/;" P line:19 language:JavaScript
79
+ e test/tests.js /^ e: {$/;" P line:249 language:JavaScript
80
+ entangld libraries/unix/include/Datastore.h /^namespace entangld$/;" n line:19 language:C++
81
+ entangld libraries/unix/include/Message.h /^namespace entangld$/;" n line:14 language:C++
82
+ entangld libraries/unix/src/Datastore.cpp /^namespace entangld$/;" n line:38 language:C++ file:
83
+ event index.js /^ static event(path, value, uuid) {$/;" M line:125 language:JavaScript
84
+ every index.js /^ every : every$/;" P line:1110 language:JavaScript
85
+ every index.js /^ every : every$/;" P line:113 language:JavaScript
86
+ extract_from_path index.js /^function extract_from_path(obj, path) {$/;" F line:464 language:JavaScript
87
+ eyes test/tests.js /^ eyes: "blue",$/;" P line:538 language:JavaScript
88
+ eyes test/tests.js /^ eyes: "blue",$/;" P line:577 language:JavaScript
89
+ f test/tests.js /^ f: {$/;" P line:21 language:JavaScript
90
+ f test/tests.js /^ f: 7$/;" P line:250 language:JavaScript
91
+ from_json libraries/unix/include/Message.h /^ static void from_json(const nlohmann::json &j, Message &msg)$/;" f line:48 language:C++ namespace:entangld signature:(const nlohmann::json &j, Message &msg)
92
+ g test/tests.js /^ g: 7$/;" P line:22 language:JavaScript
93
+ g_debug_level libraries/unix/samples/debug.c /^static int g_debug_level = 0;$/;" v line:12 language:C file:
94
+ g_shutdown_flag libraries/unix/samples/client.cpp /^volatile bool g_shutdown_flag = false;$/;" v line:22 language:C++
95
+ g_shutdown_flag libraries/unix/samples/server.cpp /^volatile bool g_shutdown_flag = false;$/;" v line:21 language:C++
96
+ get index.js /^ get(path, params) {$/;" M line:955 language:JavaScript
97
+ get index.js /^ static get(tree, get_params) {$/;" M line:56 language:JavaScript
98
+ get libraries/unix/src/Datastore.cpp /^ void Datastore::get($/;" f line:47 language:C++ class:entangld::Datastore signature:( std::string path, void (*callback)(const Message &msg, void *ctx), void *callback_ctx, std::string uuid)
99
+ get_uuidstring libraries/unix/src/Datastore.cpp /^static std::string get_uuidstring()$/;" f line:14 language:C++ file: signature:()
100
+ h test/tests.js /^ h: 4$/;" P line:27 language:JavaScript
101
+ handler libraries/unix/include/Datastore.h /^ Message::handler_t handler; \/**< Send a Message to this remote. *\/$/;" m line:112 language:C++ struct:entangld::Datastore::__anon1 access:public
102
+ handler_ctx libraries/unix/include/Datastore.h /^ void *handler_ctx; \/**< User context passed to handler. *\/$/;" m line:113 language:C++ struct:entangld::Datastore::__anon1 access:public
103
+ handler_t libraries/unix/include/Message.h /^ typedef void (*handler_t)(const Message &msg, void *ctx);$/;" t line:20 language:C++ class:entangld::Message access:public
104
+ has_downstream index.js /^ get has_downstream() {$/;" M line:263 language:JavaScript
105
+ has_upstream index.js /^ get has_upstream() {$/;" M line:275 language:JavaScript
106
+ if index.js /^ if(params.limit) {$/;" M line:1316 language:JavaScript
107
+ index index.js /^ this.index = (this.index + 1) % this.every;$/;" M line:216 language:JavaScript
108
+ is_above index.js /^ is_above(path) {$/;" M line:349 language:JavaScript
109
+ is_beneath index.js /^ is_beneath(path) {$/;" M line:339 language:JavaScript
110
+ is_beneath index.js /^function is_beneath(a, b) {$/;" F line:545 language:JavaScript
111
+ is_head index.js /^ get is_head() {$/;" M line:250 language:JavaScript
112
+ is_pass_through index.js /^ get is_pass_through() {$/;" M line:232 language:JavaScript
113
+ is_terminal index.js /^ get is_terminal() {$/;" M line:241 language:JavaScript
114
+ it test/circular.js /^ it("Circular subscriptions don't break", function(done) {$/;" M line:31 language:JavaScript
115
+ it test/sockets.js /^ it("Can get", function(done) {$/;" M line:70 language:JavaScript
116
+ it test/sockets.js /^ it("Can remove subs for persistant sockets", function(done) {$/;" M line:82 language:JavaScript
117
+ it test/sockets.js /^ it("Can remove subs for reconnected sockets", function(done) {$/;" M line:113 language:JavaScript
118
+ it test/sockets.js /^ it("Can subscribe", function(done) {$/;" M line:56 language:JavaScript
119
+ it test/sockets.js /^ it("Cannot remove subs for dropped sockets", function(done) {$/;" M line:97 language:JavaScript
120
+ it test/subscriptions.js /^ it("Can have parallel subscriptions (locallly)", function(done) {$/;" M line:117 language:JavaScript
121
+ it test/subscriptions.js /^ it("Can have parallel subscriptions (locallly)", function(done) {$/;" M line:161 language:JavaScript
122
+ it test/subscriptions.js /^ it("Can have parallel subscriptions (remote)", function(done) {$/;" M line:175 language:JavaScript
123
+ it test/subscriptions.js /^ it("Emit on each subscription", function(done) {$/;" M line:104 language:JavaScript
124
+ it test/subscriptions.js /^ it("Should emit on recieved subscriptions (locally)", function(done) {$/;" M line:37 language:JavaScript
125
+ it test/subscriptions.js /^ it("Should emit on recieved subscriptions (remote)", function(done) {$/;" M line:53 language:JavaScript
126
+ it test/subscriptions.js /^ it("Should emit on recieved unsubscriptions (locally)", function(done) {$/;" M line:44 language:JavaScript
127
+ it test/subscriptions.js /^ it("Should emit on recieved unsubscriptions (remote)", function(done) {$/;" M line:60 language:JavaScript
128
+ it test/subscriptions.js /^ it("Should only trigger subscriptions on an exact match", function(done) {$/;" M line:27 language:JavaScript
129
+ it test/subscriptions.js /^ it("Shouldn't emit on passthrough subscriptions (remote)", function(done) {$/;" M line:86 language:JavaScript
130
+ it test/subscriptions.js /^ it("Shouldn't emit on passthrough unsubscriptions (remote)", function(done) {$/;" M line:94 language:JavaScript
131
+ it test/subscriptions.js /^ it("Shouldn't emit on sent subscriptions (remote)", function(done) {$/;" M line:69 language:JavaScript
132
+ it test/subscriptions.js /^ it("Shouldn't emit on sent unsubscriptions (remote)", function(done) {$/;" M line:77 language:JavaScript
133
+ log test/sockets.js /^console.log = () => {};$/;" M line:10 language:JavaScript
134
+ long_shared libraries/unix/samples/client.cpp /^static struct option long_shared[] = {$/;" v line:25 language:C++ typeref:struct:option file:
135
+ long_shared libraries/unix/samples/server.cpp /^static struct option long_shared[] = {$/;" v line:24 language:C++ typeref:struct:option file:
136
+ m_local_data libraries/unix/include/Datastore.h /^ nlohmann::json m_local_data;$/;" m line:153 language:C++ class:entangld::Datastore access:protected
137
+ m_remotes libraries/unix/include/Datastore.h /^ std::unordered_map<std::string, remote_t> m_remotes;$/;" m line:156 language:C++ class:entangld::Datastore access:protected
138
+ m_requests libraries/unix/include/Datastore.h /^ std::unordered_map<std::string, request_t> m_requests;$/;" m line:162 language:C++ class:entangld::Datastore access:protected
139
+ m_subs libraries/unix/include/Datastore.h /^ std::vector<request_t> m_subs;$/;" m line:168 language:C++ class:entangld::Datastore access:protected
140
+ main libraries/unix/samples/client.cpp /^int main(int argc, char *argv[])$/;" f line:58 language:C++ signature:(int argc, char *argv[])
141
+ main libraries/unix/samples/server.cpp /^int main(int argc, char *argv[])$/;" f line:52 language:C++ signature:(int argc, char *argv[])
142
+ main libraries/unix/test/0.misc/test_init.cpp /^int main()$/;" f line:7 language:C++ signature:()
143
+ main libraries/unix/test/1.get/test_get_basic.cpp /^int main()$/;" f line:7 language:C++ signature:()
144
+ main libraries/unix/test/1.get/test_get_nested.cpp /^int main()$/;" f line:7 language:C++ signature:()
145
+ main libraries/unix/test/1.get/test_get_remote.cpp /^int main()$/;" f line:7 language:C++ signature:()
146
+ main libraries/unix/test/2.set/test_set_basic.cpp /^int main()$/;" f line:8 language:C++ signature:()
147
+ main libraries/unix/test/2.set/test_set_nested.cpp /^int main()$/;" f line:8 language:C++ signature:()
148
+ main libraries/unix/test/2.set/test_set_remote.cpp /^int main()$/;" f line:7 language:C++ signature:()
149
+ main libraries/unix/test/3.sub/test_sub_basic.cpp /^int main(int argc, char *argv[])$/;" f line:10 language:C++ signature:(int argc, char *argv[])
150
+ main libraries/unix/test/3.sub/test_sub_nested.cpp /^int main(int argc, char *argv[])$/;" f line:10 language:C++ signature:(int argc, char *argv[])
151
+ main libraries/unix/test/3.sub/test_sub_remote.cpp /^int main(int argc, char *argv[])$/;" f line:10 language:C++ signature:(int argc, char *argv[])
152
+ main libraries/unix/test/4.unsub/test_unsub_basic.cpp /^int main(int argc, char *argv[])$/;" f line:10 language:C++ signature:(int argc, char *argv[])
153
+ main libraries/unix/test/4.unsub/test_unsub_remote.cpp /^int main(int argc, char *argv[])$/;" f line:10 language:C++ signature:(int argc, char *argv[])
154
+ matches_event_message index.js /^ matches_event_message(msg) {$/;" M line:296 language:JavaScript
155
+ matches_path index.js /^ matches_path(path) {$/;" M line:319 language:JavaScript
156
+ matches_subscription index.js /^ matches_subscription(sub) {$/;" M line:286 language:JavaScript
157
+ matches_unsubscribe_message index.js /^ matches_unsubscribe_message(msg) {$/;" M line:309 language:JavaScript
158
+ matches_uuid index.js /^ matches_uuid(uuid) {$/;" M line:329 language:JavaScript
159
+ more_stores test/tests.js /^ more_stores: {$/;" P line:539 language:JavaScript
160
+ more_stores test/tests.js /^ more_stores: {$/;" P line:578 language:JavaScript
161
+ msg libraries/unix/include/Datastore.h /^ Message msg;$/;" m line:119 language:C++ struct:entangld::Datastore::__anon2 access:public
162
+ name libraries/unix/include/Datastore.h /^ std::string name; \/**< Namespace the store is mapped to. *\/$/;" m line:111 language:C++ struct:entangld::Datastore::__anon1 access:public
163
+ namespace index.js /^ namespace(store) {$/;" M line:627 language:JavaScript
164
+ namespaces index.js /^ get namespaces() {$/;" M line:603 language:JavaScript
165
+ p index.js /^ let p = (result && result.constructor && result.constructor.name$/;" F line:977 language:JavaScript
166
+ params index.js /^ params : params$/;" P line:888 language:JavaScript
167
+ params index.js /^ params : params$/;" P line:97 language:JavaScript
168
+ parse_namespace libraries/unix/src/Datastore.cpp /^ std::string Datastore::parse_namespace(std::string path)$/;" f line:322 language:C++ class:entangld::Datastore signature:(std::string path)
169
+ partial_copy index.js /^function partial_copy(o, max_depth) {$/;" F line:506 language:JavaScript
170
+ path index.js /^ path : path,$/;" P line:1105 language:JavaScript
171
+ path index.js /^ path : path,$/;" P line:128 language:JavaScript
172
+ path index.js /^ path : tree,$/;" P line:111 language:JavaScript
173
+ path index.js /^ path : tree,$/;" P line:95 language:JavaScript
174
+ path libraries/unix/include/Message.h /^ nlohmann::json path; \/**< Datastore path that the message is referencing. *\/$/;" m line:23 language:C++ class:entangld::Message access:public
175
+ port test/sockets.js /^ port : 9876$/;" P line:130 language:JavaScript
176
+ port test/sockets.js /^ port : 9876$/;" P line:21 language:JavaScript
177
+ port test/sockets.js /^ port : 9876$/;" P line:26 language:JavaScript
178
+ print_help libraries/unix/samples/client.cpp /^static void print_help(const char *name)$/;" f line:36 language:C++ file: signature:(const char *name)
179
+ print_help libraries/unix/samples/server.cpp /^static void print_help(const char *name)$/;" f line:34 language:C++ file: signature:(const char *name)
180
+ ptr libraries/unix/include/Datastore.h /^ nlohmann::json::json_pointer ptr;$/;" m line:125 language:C++ struct:entangld::Datastore::__anon2 access:public
181
+ push index.js /^ push(path, data, limit=null) {$/;" M line:828 language:JavaScript
182
+ push libraries/unix/include/Datastore.h /^ inline void push(std::string path, nlohmann::json value)$/;" f line:103 language:C++ class:entangld::Datastore access:public signature:(std::string path, nlohmann::json value)
183
+ receive index.js /^ receive(msg, obj) {$/;" M line:734 language:JavaScript
184
+ receive libraries/unix/src/Datastore.cpp /^ void Datastore::receive(const Message &msg, std::string name)$/;" f line:250 language:C++ class:entangld::Datastore signature:(const Message &msg, std::string name)
185
+ recurse index.js /^ function recurse(o, c, parent, key) {$/;" F line:406 language:JavaScript
186
+ remote libraries/unix/include/Datastore.h /^ remote_t *remote;$/;" m line:122 language:C++ struct:entangld::Datastore::__anon2 access:public
187
+ remote_t libraries/unix/include/Datastore.h /^ } remote_t;$/;" t line:114 language:C++ class:entangld::Datastore typeref:struct:entangld::Datastore::__anon1 access:protected
188
+ request_t libraries/unix/include/Datastore.h /^ } request_t;$/;" t line:132 language:C++ class:entangld::Datastore typeref:struct:entangld::Datastore::__anon2 access:protected
189
+ reset libraries/unix/src/Datastore.cpp /^ void Datastore::reset()$/;" f line:40 language:C++ class:entangld::Datastore signature:()
190
+ set index.js /^ set(path, data, operation_type="set", params={}) {$/;" M line:846 language:JavaScript
191
+ set libraries/unix/src/Datastore.cpp /^ void Datastore::set(std::string path, nlohmann::json value, bool push)$/;" f line:89 language:C++ class:entangld::Datastore signature:(std::string path, nlohmann::json value, bool push)
192
+ set_debug_level libraries/unix/samples/debug.c /^void set_debug_level(int debug_level)$/;" f line:14 language:C signature:(int debug_level)
193
+ setpush index.js /^ static setpush({type = "set", tree, value, params}) {$/;" M line:91 language:JavaScript
194
+ static_copy index.js /^ static_copy() {$/;" M line:362 language:JavaScript
195
+ subscribe index.js /^ static subscribe(tree, uuid, every = null) {$/;" M line:108 language:JavaScript
196
+ subscribe index.js /^ subscribe(path, func, every = null) {$/;" M line:1067 language:JavaScript
197
+ subscribe libraries/unix/src/Datastore.cpp /^ void Datastore::subscribe($/;" f line:138 language:C++ class:entangld::Datastore signature:( std::string path, void (*callback)(const Message &msg, void *ctx), void *callback_ctx, std::string uuid)
198
+ subscribed_to index.js /^ subscribed_to(path) {$/;" M line:1145 language:JavaScript
199
+ subscriptions index.js /^ get subscriptions() {$/;" M line:617 language:JavaScript
200
+ test_done libraries/unix/test/3.sub/test_sub_basic.cpp /^volatile bool test_done[3] = {false, false, false};$/;" v line:8 language:C++
201
+ test_done libraries/unix/test/3.sub/test_sub_nested.cpp /^volatile bool test_done = false;$/;" v line:8 language:C++
202
+ test_done libraries/unix/test/3.sub/test_sub_remote.cpp /^volatile bool test_done[2] = {false, false};$/;" v line:8 language:C++
203
+ test_done libraries/unix/test/4.unsub/test_unsub_basic.cpp /^volatile bool test_done[3] = {false, false, false};$/;" v line:8 language:C++
204
+ test_done libraries/unix/test/4.unsub/test_unsub_remote.cpp /^volatile bool test_done[2] = {false, false};$/;" v line:8 language:C++
205
+ title test/tests.js /^ title: "store C is located at this level"$/;" P line:541 language:JavaScript
206
+ title test/tests.js /^ title: "store C is located at this level"$/;" P line:579 language:JavaScript
207
+ to_json libraries/unix/include/Message.h /^ static void to_json(nlohmann::json &j, const Message &msg)$/;" f line:33 language:C++ namespace:entangld signature:(nlohmann::json &j, const Message &msg)
208
+ transmit index.js /^ transmit(func) {$/;" M line:715 language:JavaScript
209
+ transmit libraries/unix/include/Datastore.h /^ static inline void transmit(remote_t *remote, const Message &msg)$/;" f line:147 language:C++ class:entangld::Datastore access:protected signature:(remote_t *remote, const Message &msg)
210
+ tree index.js /^ tree : tree,$/;" P line:886 language:JavaScript
211
+ type index.js /^ type : operation_type,$/;" P line:885 language:JavaScript
212
+ type index.js /^ type : "event",$/;" P line:127 language:JavaScript
213
+ type index.js /^ type : "subscribe",$/;" P line:110 language:JavaScript
214
+ type index.js /^ type: "get",$/;" P line:58 language:JavaScript
215
+ type index.js /^ type: "unsubscribe",$/;" P line:142 language:JavaScript
216
+ type index.js /^ type: "value",$/;" P line:74 language:JavaScript
217
+ type index.js /^ type: type,$/;" P line:94 language:JavaScript
218
+ type libraries/unix/include/Message.h /^ std::string type; \/**< Message type. @see Datastore::receive *\/$/;" m line:22 language:C++ class:entangld::Message access:public
219
+ unsubscribe index.js /^ static unsubscribe(uuid) {$/;" M line:140 language:JavaScript
220
+ unsubscribe index.js /^ unsubscribe(path_or_uuid) {$/;" M line:1166 language:JavaScript
221
+ unsubscribe libraries/unix/src/Datastore.cpp /^ int Datastore::unsubscribe(std::string path, std::string uuid)$/;" f line:183 language:C++ class:entangld::Datastore signature:(std::string path, std::string uuid)
222
+ unsubscribe_tree index.js /^ unsubscribe_tree(path) {$/;" M line:1205 language:JavaScript
223
+ upstream index.js /^ upstream : (this.upstream === null ? null : true),$/;" M line:367 language:JavaScript
224
+ upstream index.js /^ upstream : upstream,$/;" P line:1107 language:JavaScript
225
+ uuid index.js /^ uuid : uuid,$/;" P line:1108 language:JavaScript
226
+ uuid index.js /^ uuid : uuid$/;" P line:130 language:JavaScript
227
+ uuid index.js /^ uuid : uuid$/;" P line:144 language:JavaScript
228
+ uuid index.js /^ uuid : uuid,$/;" P line:112 language:JavaScript
229
+ uuid libraries/unix/include/Message.h /^ std::string uuid; \/**< Unique identifier for request tracking. *\/$/;" m line:24 language:C++ class:entangld::Message access:public
230
+ uuid1 test/subscriptions.js /^ let uuid1 = s.subscribe("path2.B.some_data", () => {count += 1});$/;" F line:251 language:JavaScript
231
+ uuid1 test/subscriptions.js /^ let uuid1 = s.subscribe("some_data", () => {count += 1});$/;" F line:220 language:JavaScript
232
+ uuid2 test/subscriptions.js /^ let uuid2 = a.subscribe("path3.B.some_data", () => {count += 1})$/;" F line:252 language:JavaScript
233
+ uuid2 test/subscriptions.js /^ let uuid2 = s.subscribe("some_data", () => {count += 1});$/;" F line:221 language:JavaScript
234
+ uuids index.js /^ const uuids = subscriptions.map(s => s.uuid);$/;" F line:1243 language:JavaScript
235
+ value index.js /^ value : data,$/;" P line:887 language:JavaScript
236
+ value index.js /^ value : get_params,$/;" P line:60 language:JavaScript
237
+ value index.js /^ value : value,$/;" P line:129 language:JavaScript
238
+ value index.js /^ value : value,$/;" P line:76 language:JavaScript
239
+ value index.js /^ value : value,$/;" P line:96 language:JavaScript
240
+ value index.js /^ static value(get_msg, value) {$/;" M line:72 language:JavaScript
241
+ value libraries/unix/include/Message.h /^ nlohmann::json value; \/**< Message payload. *\/$/;" m line:25 language:C++ class:entangld::Message access:public
242
+ wait test/circular.js /^function wait (ms) {$/;" F line:3 language:JavaScript
243
+ wait test/sockets.js /^function wait (ms) {$/;" F line:5 language:JavaScript
244
+ while index.js /^ while(A.length && B.length){$/;" M line:557 language:JavaScript
package/test/circular.js CHANGED
@@ -1,9 +1,5 @@
1
1
  var Entangld=require("../index.js");
2
2
 
3
- function wait (ms) {
4
- return new Promise(res=>setTimeout(res,ms));
5
- }
6
-
7
3
  describe("Circular References", function() {
8
4
  let s,a,b;
9
5
 
@@ -23,9 +19,9 @@ describe("Circular References", function() {
23
19
  });
24
20
 
25
21
  afterEach(function() {
26
- delete s;
27
- delete a;
28
- delete b;
22
+ delete s; // eslint-disable-line no-delete-var
23
+ delete a; // eslint-disable-line no-delete-var
24
+ delete b; // eslint-disable-line no-delete-var
29
25
  });
30
26
 
31
27
  it("Circular subscriptions don't break", function(done) {
package/test/events.js CHANGED
@@ -37,7 +37,7 @@ describe("Events",()=>{
37
37
  S.transmit((msg, store)=>store.receive(msg, S));
38
38
  A.transmit((msg, store)=>store.receive(msg, A));
39
39
  B.transmit((msg, store)=>store.receive(msg, B));
40
-
40
+
41
41
  });
42
42
 
43
43
 
package/test/sockets.js CHANGED
@@ -1,16 +1,16 @@
1
- const Entangld=require("../index.js");
2
- const sockhop=require("sockhop");
3
- const assert=require("assert");
1
+ const Entangld=require("../lib/Datastore.js");
2
+ const sockhop=require("sockhop"); // eslint-disable-line node/no-unpublished-require
4
3
 
5
4
  function wait (ms) {
6
5
  return new Promise(res=>setTimeout(res,ms));
7
6
  }
8
7
 
9
8
  // FIXME : comment out for debugging
10
- console.log = () => {};
9
+ // const _log = console.log;
10
+ const _log = () => {};
11
11
 
12
12
  describe("Sockets", function() {
13
- let server,client,sock_ref,s,a,b;
13
+ let server,client,sock_ref,s,a;
14
14
 
15
15
  beforeEach(function() {
16
16
  s = new Entangld();
@@ -19,21 +19,21 @@ describe("Sockets", function() {
19
19
  server = new sockhop.server({
20
20
  address : "localhost",
21
21
  port : 9876
22
- })
23
- server.on("receive", (o, meta) => { console.log("s.r",o); s.receive(o, meta.socket) } );
22
+ });
23
+ server.on("receive", (o, meta) => { _log("s.r",o); s.receive(o, meta.socket); } );
24
24
  client = new sockhop.client({
25
25
  address : "localhost",
26
26
  port : 9876
27
- })
28
- client.on("receive", (o, meta) => { console.log("c.r",o); a.receive(o, client) });
27
+ });
28
+ client.on("receive", (o) => { _log("c.r",o); a.receive(o, client); });
29
29
 
30
30
 
31
31
  s.transmit((msg, socket) => { // server's transmit to net-sockets
32
- console.log("s.t",msg);
32
+ _log("s.t",msg);
33
33
  if ( socket.readyState == 'open' ) server.send(socket, msg);
34
34
  });
35
35
  a.transmit((msg, client) => { // client's transmit to sockhop client
36
- console.log("a.t",msg);
36
+ _log("a.t",msg);
37
37
  if ( client.connected ) client.send(msg);
38
38
  });
39
39
 
@@ -46,11 +46,11 @@ describe("Sockets", function() {
46
46
  });
47
47
 
48
48
  afterEach(function() {
49
- delete s;
50
- delete a;
49
+ delete s; // eslint-disable-line no-delete-var
50
+ delete a; // eslint-disable-line no-delete-var
51
51
  server.close();
52
- delete server;
53
- delete client;
52
+ delete server; // eslint-disable-line no-delete-var
53
+ delete client; // eslint-disable-line no-delete-var
54
54
  });
55
55
 
56
56
  it("Can subscribe", function(done) {
@@ -86,7 +86,7 @@ describe("Sockets", function() {
86
86
  while ( sock_ref.readyState !== "open" ) await wait(1);
87
87
  s.subscribe("path1.a.data");
88
88
  while ( a._subscriptions.length < 1 ) await wait(1);
89
- s.detach("path1.a")
89
+ s.detach("path1.a");
90
90
  s.attach("path1.a",new Entangld());
91
91
  await wait(5); // set messages clear
92
92
  if ( a._subscriptions.length !== 0 ) done(new Error("Subscription never removed"));
@@ -102,7 +102,7 @@ describe("Sockets", function() {
102
102
  s.subscribe("path1.a.data");
103
103
  while ( a._subscriptions.length < 1 ) await wait(1);
104
104
  client.disconnect(); // kill the socket
105
- s.detach("path1.a")
105
+ s.detach("path1.a");
106
106
  s.attach("path1.a",new Entangld());
107
107
  await wait(5); // set messages clear
108
108
  if ( a._subscriptions.length !== 1 ) done(new Error("Subscription was removed!?"));
@@ -128,8 +128,8 @@ describe("Sockets", function() {
128
128
  client = new sockhop.client({
129
129
  address : "localhost",
130
130
  port : 9876
131
- })
132
- client.on("receive", (o, meta) => { console.log("c.r",o); a.receive(o, client) });
131
+ });
132
+ client.on("receive", (o) => { _log("c.r",o); a.receive(o, client); });
133
133
  client.connect();
134
134
  while ( !sock_ref ) await wait(1);
135
135
  while ( sock_ref.readyState !== "open" ) await wait(1);