entangld 2.1.4 → 2.1.6

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.
Files changed (4) hide show
  1. package/index.js +21 -18
  2. package/package.json +5 -5
  3. package/tags +244 -0
  4. package/test/tests.js +12 -0
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const Uuid = require("uuid");
1
+ const { v4:uuidv4 } = require("uuid");
2
2
  const EventEmitter = require("events");
3
3
  const uuid_regex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
4
4
 
@@ -58,7 +58,7 @@ class Entangld_Message {
58
58
  type: "get",
59
59
  path : tree, // path needs to be relative to downstream store
60
60
  value : get_params,
61
- uuid : Uuid() // Gets generate a new uuid
61
+ uuid : uuidv4() // Gets generate a new uuid
62
62
  });
63
63
  }
64
64
 
@@ -102,7 +102,7 @@ class Entangld_Message {
102
102
  * Construct subscribe message
103
103
  *
104
104
  * @param {string} tree - the path (relative to the downstream datastore)
105
- * @param {Uuid} uuid - the subscription uuid
105
+ * @param {uuidv4} uuid - the subscription uuid
106
106
  * @return {Entangld_Message} the `subscribe` message
107
107
  */
108
108
  static subscribe(tree, uuid, every = null) {
@@ -119,7 +119,7 @@ class Entangld_Message {
119
119
  *
120
120
  * @param {string} path - the path (relative to the downstream store)
121
121
  * @param {*} value - the updated datastore value at the path
122
- * @param {Uuid} uuid - the uuid of the subscribe being triggered
122
+ * @param {uuidv4} uuid - the uuid of the subscribe being triggered
123
123
  * @return {Entangld_Message} the `event` message
124
124
  */
125
125
  static event(path, value, uuid) {
@@ -170,7 +170,7 @@ class Subscription {
170
170
  * @param {Object} obj - the configuration object
171
171
  * @param {string} obj.path - the datastore path (relative to this datastore)
172
172
  * of the subscription
173
- * @param {Uuid} obj.uuid - the uuid of the subscription chain
173
+ * @param {uuidv4} obj.uuid - the uuid of the subscription chain
174
174
  * @param {function} obj.callback - the callback function, with signature (path, value),
175
175
  * where path is relative to this datastore
176
176
  * @param {(Entangld|null)} obj.downstream - the downstream datastore (if any)
@@ -323,7 +323,7 @@ class Subscription {
323
323
  /**
324
324
  * Check if a provided uuid matches this uuid
325
325
  *
326
- * @param {Uuid} uuid - a uuid string to check against
326
+ * @param {uuidv4} uuid - a uuid string to check against
327
327
  * @return {Boolean} - true if the path matches
328
328
  */
329
329
  matches_uuid(uuid) {
@@ -362,8 +362,8 @@ class Subscription {
362
362
  static_copy() {
363
363
  return new Subscription({
364
364
  path : this.path,
365
- uuid : this.uuid,
366
- downstream : (this.downstream === null ? null : true),
365
+ uuid : this.uuid,
366
+ downstream : (this.downstream === null ? null : true),
367
367
  upstream : (this.upstream === null ? null : true),
368
368
  every : this.every
369
369
  })
@@ -751,6 +751,9 @@ class Entangld extends EventEmitter {
751
751
  let resolve = this._requests[msg.uuid];
752
752
  resolve(msg.value);
753
753
 
754
+ //Clean up request
755
+ delete this._requests[msg.uuid];
756
+
754
757
  } else if (msg.type == "event") {
755
758
  // Incoming event
756
759
  if (obj === undefined)
@@ -1059,7 +1062,7 @@ class Entangld extends EventEmitter {
1059
1062
  * @param {number|null} [every=null] the number of `set` messages to wait before calling callback
1060
1063
  *
1061
1064
  * @throws {TypeError} if path is not a string.
1062
- * @return {Uuid} - the uuid of the subscription
1065
+ * @return {uuidv4} - the uuid of the subscription
1063
1066
  */
1064
1067
  subscribe(path, func, every = null) {
1065
1068
 
@@ -1076,19 +1079,19 @@ class Entangld extends EventEmitter {
1076
1079
  * @param {string} path the path to watch.
1077
1080
  * @param {function} func the callback - will be of the form (path, value).
1078
1081
  * @param {(Entangld|null)} [upstream=null] the Engangld next upstream in the path.
1079
- * @param {(Uuid|null)} [uuid=null] the UUID to use for this subscription.
1080
- *
1082
+ * @param {(uuidv4|null)} [uuid=null] the UUID to use for this subscription.
1083
+ *
1081
1084
  * @emits {str} subscription - when this datastore is the terminal datastore of a
1082
1085
  * subscription request, this datastore emits the path
1083
1086
  * and uuid.
1084
1087
  * @throws {TypeError} if path is not a string.
1085
- * @return {Uuid} - the uuid of the subscription
1088
+ * @return {uuidv4} - the uuid of the subscription
1086
1089
  */
1087
1090
  _subscribe(path, func, upstream = null, uuid = null, every = null) {
1088
1091
 
1089
1092
 
1090
1093
  // Supply a UUID if none provided
1091
- uuid = uuid || Uuid();
1094
+ uuid = uuid || uuidv4();
1092
1095
 
1093
1096
 
1094
1097
  // Sanity check
@@ -1107,14 +1110,14 @@ class Entangld extends EventEmitter {
1107
1110
  every : every
1108
1111
  })
1109
1112
  // Filter out any residual subscriptions
1110
- // Note, residual subscriptions should only exist if a remote datastore (connected via a
1113
+ // Note, residual subscriptions should only exist if a remote datastore (connected via a
1111
1114
  // socket, or something like that) re-attaches this datastore after the connection between
1112
- // the two was uncerimonally destroyed, otherwise the internal clean up of the attach
1115
+ // the two was uncerimonally destroyed, otherwise the internal clean up of the attach
1113
1116
  // should have propegated down to prevent this.
1114
1117
  // Note, this should still allow circular references, since "match_subscriptions" requires
1115
1118
  // both the uuid and path to match
1116
1119
  this._subscriptions = this._subscriptions.filter(sub => !new_sub.matches_subscription(sub));
1117
-
1120
+
1118
1121
  // Add the new subscription here
1119
1122
  this._subscriptions.push(new_sub);
1120
1123
 
@@ -1124,7 +1127,7 @@ class Entangld extends EventEmitter {
1124
1127
  this._transmit(msg, obj);
1125
1128
 
1126
1129
  } else { // this is the terminal datastore, so emit subscription received
1127
- this.emit("subscription", path, uuid)
1130
+ this.emit("subscription", path, uuid)
1128
1131
  }
1129
1132
 
1130
1133
  return new_sub.uuid
@@ -1156,7 +1159,7 @@ class Entangld extends EventEmitter {
1156
1159
  * path will be deleted, so if you have multiple subscriptions on a single path,
1157
1160
  * and only want one of them to be removed, you must provide the uuid instead.
1158
1161
  *
1159
- * @param {(String|Uuid)} path_or_uuid - the path (or uuid) to unwatch.
1162
+ * @param {(String|uuidv4)} path_or_uuid - the path (or uuid) to unwatch.
1160
1163
  * @throws {EntangldError} if no subscriptions were found.
1161
1164
  * @return {number} count of subscriptions removed.
1162
1165
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "entangld",
3
- "version": "2.1.4",
3
+ "version": "2.1.6",
4
4
  "description": "Synchronized key-value stores with RPCs and events",
5
5
  "main": "index.js",
6
6
  "jshintConfig": {
@@ -29,14 +29,14 @@
29
29
  "homepage": "https://daxbot.com/open-source",
30
30
  "devDependencies": {
31
31
  "fs-then-native": "^2.0.0",
32
- "jsdoc-to-markdown": "^6.0.1",
32
+ "jsdoc-to-markdown": "^7.1.1",
33
33
  "jshint": "^2.13.1",
34
34
  "jshint-stylish": "^2.2.1",
35
- "mocha": "^8.4.0",
36
- "nodemon": "^1.11.0",
35
+ "mocha": "^10.0.0",
36
+ "nodemon": "^2.0.16",
37
37
  "sockhop": "^1.4.3"
38
38
  },
39
39
  "dependencies": {
40
- "uuid": "^3.0.1"
40
+ "uuid": "^8.3.2"
41
41
  }
42
42
  }
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/tests.js CHANGED
@@ -178,6 +178,7 @@ describe("Local storage",()=>{
178
178
  });
179
179
  });
180
180
 
181
+
181
182
  it("Set entire tree at empty path",()=>{
182
183
 
183
184
  let s=new Entangld();
@@ -351,6 +352,17 @@ describe("Multiplexed stores",()=>{
351
352
 
352
353
  });
353
354
 
355
+ it("Removes internal _requests reference after get", ()=>{
356
+
357
+ var request_length = Object.keys(s._requests).length;
358
+
359
+ return s.get("a.system.speed").then((val)=>{
360
+
361
+ assert.strictEqual(request_length, Object.keys(s._requests).length);
362
+ return Promise.resolve();
363
+ });
364
+ });
365
+
354
366
  it("Remote set single root value into child store", ()=>{
355
367
 
356
368
  s.set("b.something",99);