Skip to content

Commit 353aef6

Browse files
committed
Fixes based quantum game execution
1 parent 78500de commit 353aef6

File tree

7 files changed

+5157
-9
lines changed

7 files changed

+5157
-9
lines changed

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ const endpoint2 = vnfHub.openEndpoint("endpoint2-name")
130130
```js
131131
// Creating in browser hub of endpoints
132132
const webSocketFactory = new Vnf.WebSocketFactory("wss://<server-host-name>/webbroker/vnf-ws")
133-
const vnfHub = new Vnf.MarshallerHub(new Vnf.ReliableRtcHub((webSocketFactory)));
133+
const vnfHub = new Vnf.MarshallerHub(new Vnf.ReliableRtcHub(new Vnf.WebSocketHub(webSocketFactory)));
134134

135135
// Creating endpoint in hub
136136
const endpoint1 = vnfHub.openEndpoint("endpoint1-name")
@@ -182,7 +182,9 @@ const registryClient = new Vnf.WebSocketRegistryClient(new Vnf.WebSocketRpc(eva,
182182

183183
```
184184

185-
### WebSocketRegistry and WebScoketHub
185+
# VNF Channel and Registry examples
186+
187+
## WebSocketRegistry and WebScoketHub
186188
```js
187189
const webSocketFactory = new Vnf.WebSocketFactory("wss://<server-host-name>/webbroker/vnf-ws")
188190
const vnfHub = new Vnf.WebSocketHub(webSocketFactory);
@@ -194,4 +196,22 @@ const registryClient = new Vnf.WebSocketRegistryClient(endpoint1.getWebSocketRpc
194196
// Rest part the same as InBrowserRegistry
195197
...
196198

199+
```
200+
201+
### WebSocketRegistry and RtcHub
202+
```js
203+
// Creating in browser hub of endpoints
204+
const webSocketFactory = new Vnf.WebSocketFactory("wss://<server-host-name>/webbroker/vnf-ws")
205+
const webSocketHub = new Vnf.WebSocketHub(webSocketFactory)
206+
const vnfHub = new Vnf.MarshallerHub(new Vnf.ReliableRtcHub(webSocketHub));
207+
208+
// Creating endpoint in hub
209+
const endpoint1 = vnfHub.openEndpoint("endpoint1-name")
210+
const webSocketRpc = webSocketHub.openEndpoint("endpoint1-name").getWebSocketRpc()
211+
212+
const registryClient = new Vnf.WebSocketRegistryClient(webSocketRpc)
213+
214+
// Rest part the same as InBrowserRegistry
215+
...
216+
197217
```

TODO.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33

44
# Todo List
5-
1. Apply library for quantum game
5+
1. Fix, library mode shouldn't generate VNF.VNF.InBrowser
6+
2. Timeouts.iceSendTimeout - doesn't works by default
67

78

89
# Future tasks/On-Hold
@@ -45,4 +46,5 @@
4546
1. rename big message to name according to specification document (Marshaller Hub) (Done)
4647
1. Rename store to registry
4748
1. Update specification
48-
1. update code (store persistent thing)
49+
1. update code (store persistent thing)
50+
1. Registry: most of the command can do with retry

dist/amid-ukr-vnf.js

Lines changed: 418 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/main.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/vnf/registry/websocket-registry-client.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function WebSocketRegistryClient(webSocketRpc) {
6868
this.createOrUpdate = function(key, value) {
6969
validateKey(key);
7070

71-
return webSocketRpc.invoke("CREATE-OR-UPDATE-ENTRY", key.collection + "\n" + key.name + "\n" + VnfSerializer.serializeValue(value))
71+
return webSocketRpc.invoke("CREATE-OR-UPDATE-ENTRY", key.collection + "\n" + key.name + "\n" + VnfSerializer.serializeValue(value),{retryResend: true})
7272
.then(function(evt) {
7373
if(evt.data == Global.OK) {
7474
putToCache(key, value);
@@ -81,7 +81,7 @@ export function WebSocketRegistryClient(webSocketRpc) {
8181
this.getEntry = function(key, value) {
8282
validateKey(key);
8383

84-
return webSocketRpc.invoke("GET-ENTRY", key.collection + "\n" + key.name)
84+
return webSocketRpc.invoke("GET-ENTRY", key.collection + "\n" + key.name, {retryResend: true})
8585
.then(function(evt) {
8686
return VnfSerializer.deserializeValue(evt.data);
8787
});
@@ -90,7 +90,7 @@ export function WebSocketRegistryClient(webSocketRpc) {
9090
this.getEntriesWithBody = function(collection) {
9191
if(collection.indexOf("\n") != -1) throw new Error("EOL character isn't supported in collection name");
9292

93-
return webSocketRpc.invoke("GET-ENTRIES-WITH-BODY", collection)
93+
return webSocketRpc.invoke("GET-ENTRIES-WITH-BODY", collection, {retryResend: true})
9494
.then(function(evt){
9595
var result = {};
9696

@@ -121,7 +121,7 @@ export function WebSocketRegistryClient(webSocketRpc) {
121121
this.deleteEntry = function(key) {
122122
validateKey(key);
123123

124-
return webSocketRpc.invoke("DELETE-ENTRY", key.collection + "\n" + key.name)
124+
return webSocketRpc.invoke("DELETE-ENTRY", key.collection + "\n" + key.name, {retryResend: true})
125125
.then(function(evt) {
126126
if(evt.data == Global.OK) {
127127
deleteFromCache(key);

0 commit comments

Comments
 (0)