vrpc 2.6.0 → 3.0.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/CHANGELOG.md +83 -0
- package/LICENSE +1 -1
- package/README.md +34 -60
- package/binding.gyp.no-auto +4 -26
- package/browser/vrpc.js +1 -1
- package/index.js +2 -2
- package/package.json +16 -17
- package/vrpc/VrpcAdapter.js +293 -311
- package/vrpc/VrpcAgent.js +94 -87
- package/vrpc/{VrpcRemote.js → VrpcClient.js} +375 -413
- package/vrpc/VrpcNative.js +330 -0
- package/vrpc/{vrpc.hpp → adapter.hpp} +1003 -1115
- package/vrpc/addon.cpp +6 -6
- package/vrpc/json.hpp +1769 -870
- package/vrpc/vrpc-agent-js +4 -4
- package/README.rst +0 -18
- package/third_party/include/catch.hpp +0 -12749
- package/third_party/install.sh +0 -22
- package/vrpc/VrpcLocal.js +0 -269
- package/vrpc/VrpcLocal.py +0 -171
- package/vrpc/__init__.py +0 -1
- package/vrpc/module.cpp +0 -183
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,89 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [3.0.0] - Jan 20 2022
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `vrpcOn` / `vrpcOff` feature to client
|
|
13
|
+
- tests exclusively for VrpcAdapter
|
|
14
|
+
- support for `path.join(__dirname, <path>)` expressions when registering class
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- unhandled promise rejection on initial connect timeout
|
|
19
|
+
- missing documentation for VrpcNative
|
|
20
|
+
- bug on new `vrpcOn` feature
|
|
21
|
+
- bug while unregister event listeners via "off" or "removeAllListeners"
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- error messages as triggered on remote agents (now include context info)
|
|
26
|
+
- removed obsolete public API from VrpcAdapter
|
|
27
|
+
- internal handling of EventEmitter subscriptions
|
|
28
|
+
- now publishing a single message per event to a fixed topic
|
|
29
|
+
- dispatching happens by the broker not by the agent anymore
|
|
30
|
+
- this saves a lot of traffic when many clients subscribe to same events
|
|
31
|
+
- reduced size of response messages by skipping redundant information
|
|
32
|
+
- order of items within RPC message
|
|
33
|
+
- promise rejection message as triggered on remote agents (now include context
|
|
34
|
+
info)
|
|
35
|
+
|
|
36
|
+
## [3.0.0-alpha.3] - 25 Nov 2021
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
|
|
40
|
+
- missing 'create' event in VrpcAdapter
|
|
41
|
+
- respecting isolation state in callAll
|
|
42
|
+
|
|
43
|
+
### Changed
|
|
44
|
+
|
|
45
|
+
- cleaned API and tests from deprecation supports, those will now result in
|
|
46
|
+
errors
|
|
47
|
+
- intercepting return value of EventEmitter functions and changing it from
|
|
48
|
+
potentially gigantic object (as it returns `this`) to `true`
|
|
49
|
+
|
|
50
|
+
## [3.0.0-alpha.2] - 19 Nov 2021
|
|
51
|
+
|
|
52
|
+
### Fixed
|
|
53
|
+
|
|
54
|
+
- leaking event registrations on remote-controlled instance when event consumer
|
|
55
|
+
was not creator of the instance
|
|
56
|
+
|
|
57
|
+
## Changed
|
|
58
|
+
|
|
59
|
+
- reduced payload of callback message by omitting the original return value
|
|
60
|
+
- changed prefix of mqtt client id to `vc3` and `va3`, respectively
|
|
61
|
+
|
|
62
|
+
## [3.0.0-alpha.1] - 10 Nov 2021
|
|
63
|
+
|
|
64
|
+
### Changed
|
|
65
|
+
|
|
66
|
+
- layout and content of this repository, only javascript related code is left
|
|
67
|
+
- naming of public API classes is made consistent
|
|
68
|
+
- VrpcAdapter
|
|
69
|
+
- VrpcAgent
|
|
70
|
+
- VrpcClient (formerly VrpcRemote)
|
|
71
|
+
- VrpcNative (formerly VrpcLocal)
|
|
72
|
+
- RPC wire protocol got changed and simplified, a protocol version is attached
|
|
73
|
+
to every message (`v: 3`)
|
|
74
|
+
- concept of isolated and shared proxy instances
|
|
75
|
+
([#51](https://github.com/heisenware/vrpc/issues/51)) got implemented
|
|
76
|
+
- all namings including 'binding' got renamed for the more appropriate 'adapter'
|
|
77
|
+
- calling embedded C++ code got a completely new API (VrpcNative)
|
|
78
|
+
|
|
79
|
+
### Added
|
|
80
|
+
|
|
81
|
+
- injection of proxy-, instance-, and client id into proxy instance [Node.js] (#49)
|
|
82
|
+
- public accessor for client id [Node.js] (#49)
|
|
83
|
+
- signal `clientGone` on agent, indicating that a state-changing client went
|
|
84
|
+
[Node.js]
|
|
85
|
+
|
|
86
|
+
### Fixed
|
|
87
|
+
|
|
88
|
+
- Bug during clientId extraction for an exited client (causing leaks for
|
|
89
|
+
anonymous instances)
|
|
90
|
+
|
|
8
91
|
## [2.6.0] - 12 Jul 2021
|
|
9
92
|
|
|
10
93
|
### Added
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2018 -
|
|
3
|
+
Copyright (c) 2018 - 2022 Dr. Burkhard C. Heisen
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -1,76 +1,50 @@
|
|
|
1
1
|
# VRPC - Variadic Remote Procedure Calls
|
|
2
2
|
|
|
3
|
-
[](https://raw.githubusercontent.com/heisenware/vrpc/master/LICENSE)
|
|
3
|
+
[](https://raw.githubusercontent.com/heisenware/vrpc-js/master/LICENSE)
|
|
5
4
|
[](https://semver.org/spec/v2.0.0.html)
|
|
6
|
-
[](https://github.com/heisenware/vrpc/tag)
|
|
7
|
-
[](http://github.com/heisenware/vrpc/issues)
|
|
5
|
+
[](https://github.com/heisenware/vrpc-js/tag)
|
|
6
|
+
[](http://github.com/heisenware/vrpc-js/issues)
|
|
7
|
+

|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
## Visit our website: https://vrpc.io
|
|
11
|
-
---
|
|
9
|
+
## Visit our website: [vrpc.io](https://vrpc.io)
|
|
12
10
|
|
|
13
11
|
## What is VRPC?
|
|
14
12
|
|
|
15
|
-
VRPC - Variadic Remote Procedure Calls - is
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
VRPC - Variadic Remote Procedure Calls - is an enhancement of the old RPC
|
|
14
|
+
(remote procedure calls) idea. Like RPC, it allows to directly call functions
|
|
15
|
+
written in any programming language by functions written in any other (or the
|
|
16
|
+
same) programming language. Unlike RPC, VRPC furthermore supports:
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
- non-intrusive adaption of existing code, making it callable remotely
|
|
19
|
+
- remote function calls on many distributed receivers at the same time (one
|
|
20
|
+
client - multiple agents)
|
|
21
|
+
- service discovery
|
|
22
|
+
- outbound-connection-only network architecture (using MQTT technology)
|
|
23
|
+
- isolated (multi-tenant) and shared access modes to remote resources
|
|
24
|
+
- asynchronous language constructs (callbacks, promises, event-loops)
|
|
25
|
+
- OOP (classes, objects, member functions) and functional (lambda) patterns
|
|
26
|
+
- exception forwarding
|
|
21
27
|
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
schemas
|
|
25
|
-
- without the need to run a server
|
|
28
|
+
VRPC is available for an entire spectrum of programming technologies including
|
|
29
|
+
embedded, data-science, and web technologies.
|
|
26
30
|
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
As a robust and highly performing communication system, it can build the
|
|
32
|
+
foundation of complex digitization projects in the area of (I)IoT or
|
|
33
|
+
Cloud-Computing.
|
|
29
34
|
|
|
30
|
-
|
|
31
|
-
- language native and custom data type support
|
|
32
|
-
- callback mechanisms
|
|
33
|
-
- asynchronicity (i.e. event-loop integration)
|
|
34
|
-
- exception handling
|
|
35
|
-
- object orientation
|
|
36
|
-
- lambda and closures support
|
|
35
|
+
## This is VRPC for Javascript (Node.js and Browser)
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
dynamic linkage), executable or source package.
|
|
37
|
+
Understand how to use it by looking at the examples:
|
|
40
38
|
|
|
41
|
-
|
|
39
|
+
- [Agent Example](examples/01-agent/README.md)
|
|
40
|
+
- [Client Example](examples/02-client/README.md)
|
|
41
|
+
- [Simple C++ Embedding Example](examples/03-native-simple/README.md)
|
|
42
|
+
- [Advanced C++ Embedding Example](examples/04-native-advanced/README.md)
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
Get all the details by reading the documentation:
|
|
44
45
|
|
|
45
|
-
- [
|
|
46
|
-
- [
|
|
46
|
+
- [API Reference](docs/api.md)
|
|
47
|
+
- [RPC Protocol Details](docs/protocol.md)
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
- [Simple C++ to Python Binding Example](docs/examples/CppPythonExample1.md)
|
|
51
|
-
- [Advanced C++ to Python Binding Example](docs/examples/CppPythonExample2.md)
|
|
52
|
-
|
|
53
|
-
### Making existing C++ code remotely callable (agent)
|
|
54
|
-
|
|
55
|
-
- [Simple C++ Agent Example](docs/examples/CppAgentLinuxExample1.md)
|
|
56
|
-
- [Advanced C++ Agent Example](docs/examples/CppAgentLinuxExample2.md)
|
|
57
|
-
|
|
58
|
-
### Making existing Node.js code remotely callable (agent)
|
|
59
|
-
|
|
60
|
-
- [Node.js Agent Example](docs/examples/NodeAgentExample.md)
|
|
61
|
-
|
|
62
|
-
### Calling code remotely from Node.js (client)
|
|
63
|
-
|
|
64
|
-
- [Node.js Remote Client Example](docs/examples/NodeClientExample.md)
|
|
65
|
-
|
|
66
|
-
### Frontend-Backend communication
|
|
67
|
-
|
|
68
|
-
- [Simple React Todos App](https://github.com/heisenware/react-vrpc/tree/master/examples/vrpc-react-todos-1)
|
|
69
|
-
- [Advanced React Todos App](https://github.com/heisenware/react-vrpc/tree/master/examples/vrpc-react-todos-2)
|
|
70
|
-
|
|
71
|
-
## Reference Documentation
|
|
72
|
-
|
|
73
|
-
- [RPC Protocol Details](docs/reference/remoteProtocol.md)
|
|
74
|
-
- [C++ Binding Syntax](docs/reference/cppBinding.md)
|
|
75
|
-
- [C++ Agent](docs/reference/cppAgent.md)
|
|
76
|
-
- [Node.js API](docs/reference/nodeJs.md)
|
|
49
|
+
> This open-source project is professionally managed and supported by
|
|
50
|
+
> [Heisenware GmbH](https://heisenware.com).
|
package/binding.gyp.no-auto
CHANGED
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
['"<!(echo $VRPC_DEBUG)"=="1"', {'defines': ['VRPC_DEBUG']}],
|
|
7
7
|
],
|
|
8
8
|
'defines': ['VRPC_WITH_DL'],
|
|
9
|
-
'sources': ['vrpc/addon.cpp'],
|
|
10
|
-
'include_dirs': ['cpp'],
|
|
11
9
|
'cflags_cc!': ['-std=gnu++0x', '-fno-rtti', '-fno-exceptions'],
|
|
12
10
|
'cflags_cc': ['-std=c++14', '-fPIC'],
|
|
13
11
|
'conditions': [
|
|
@@ -17,7 +15,9 @@
|
|
|
17
15
|
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
|
|
18
16
|
}
|
|
19
17
|
}]
|
|
20
|
-
]
|
|
18
|
+
],
|
|
19
|
+
'sources': ['vrpc/addon.cpp'],
|
|
20
|
+
'include_dirs': ['.']
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
'target_name': 'vrpc_test',
|
|
@@ -36,29 +36,7 @@
|
|
|
36
36
|
}]
|
|
37
37
|
],
|
|
38
38
|
'sources': ['vrpc/addon.cpp'],
|
|
39
|
-
'include_dirs': ['
|
|
39
|
+
'include_dirs': ['.', 'tests/native/fixtures']
|
|
40
40
|
},
|
|
41
|
-
{
|
|
42
|
-
'target_name': 'vrpc-test',
|
|
43
|
-
'target_conditions': [
|
|
44
|
-
['"<!(echo $VRPC_DEBUG)"=="1"', {'defines': ['VRPC_DEBUG']}],
|
|
45
|
-
],
|
|
46
|
-
'type': 'executable',
|
|
47
|
-
'sources': [
|
|
48
|
-
'test/cpp/main.cpp',
|
|
49
|
-
'test/cpp/vrpcTest.cpp'
|
|
50
|
-
],
|
|
51
|
-
'include_dirs': ['third_party/include', 'vrpc'],
|
|
52
|
-
'cflags_cc!': ['-std=gnu++0x', '-fno-rtti', '-fno-exceptions'],
|
|
53
|
-
'cflags_cc': ['-std=c++14'],
|
|
54
|
-
'conditions': [
|
|
55
|
-
['OS=="mac"', {
|
|
56
|
-
'xcode_settings': {
|
|
57
|
-
'GCC_ENABLE_CPP_RTTI': 'YES',
|
|
58
|
-
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
|
|
59
|
-
}
|
|
60
|
-
}]
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
41
|
]
|
|
64
42
|
}
|