Skip to content

Commit

Permalink
New Connection Status Indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
sentivate committed Mar 3, 2022
1 parent 8e9f0c8 commit 56afe00
Show file tree
Hide file tree
Showing 36 changed files with 65 additions and 37 deletions.
6 changes: 4 additions & 2 deletions uwBridge/apps/client/example!/filesystem/public/Sentivate.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 12 additions & 6 deletions uwBridge/apps/client/example!/filesystem/public/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4322,7 +4322,12 @@
const socketIsReady = (data) => {
console.log('Socket Is Ready');
if (alreadySetup) {
update('_');
update({
type: 'connection',
data: {
type: 'reconnected'
}
});
} else {
post$1('ready', {
language: data.language
Expand Down Expand Up @@ -4404,10 +4409,6 @@
}
return false;
};
/*
This async streams required filesLoadedfrom socket
or from cache.
*/
assign(app.events.socket, {
async get(options, workerInfo) {
const { data } = options;
Expand Down Expand Up @@ -4457,7 +4458,12 @@
if (reason === 'io server disconnect') {
socket.connect();
}
update('_');
update({
type: 'connection',
data: {
type: 'disconnected'
}
});
});
};
app.events.configure = (data) => {
Expand Down
6 changes: 4 additions & 2 deletions uwBridge/system/compile/build/front/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions uwBridge/system/compile/build/front/coreBundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,12 @@
if (!Watcher.status || !json) {
return;
}
const type = json.type;
const {
type, name: dataName
} = json;
const levelObject = Watcher.containerPrimary[type] || Watcher.containerPrimary[json.name];
await eachAsync$2(Watcher.containerRegex, async (watcher) => {
if (watcher.regex.test(type)) {
if (watcher.regex.test(type) || watcher.regex.test(dataName)) {
return watcher(json);
}
});
Expand Down
18 changes: 12 additions & 6 deletions uwBridge/system/compile/build/worker/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4322,7 +4322,12 @@
const socketIsReady = (data) => {
console.log('Socket Is Ready');
if (alreadySetup) {
update('_');
update({
type: 'connection',
data: {
type: 'reconnected'
}
});
} else {
post$1('ready', {
language: data.language
Expand Down Expand Up @@ -4404,10 +4409,6 @@
}
return false;
};
/*
This async streams required filesLoadedfrom socket
or from cache.
*/
assign(app.events.socket, {
async get(options, workerInfo) {
const { data } = options;
Expand Down Expand Up @@ -4457,7 +4458,12 @@
if (reason === 'io server disconnect') {
socket.connect();
}
update('_');
update({
type: 'connection',
data: {
type: 'disconnected'
}
});
});
};
app.events.configure = (data) => {
Expand Down
18 changes: 12 additions & 6 deletions uwBridge/system/compile/build/worker/coreBundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@
const socketIsReady = (data) => {
console.log('Socket Is Ready');
if (alreadySetup) {
update('_');
update({
type: 'connection',
data: {
type: 'reconnected'
}
});
} else {
post$1('ready', {
language: data.language
Expand Down Expand Up @@ -161,10 +166,6 @@
}
return false;
};
/*
This async streams required filesLoadedfrom socket
or from cache.
*/
assign(app.events.socket, {
async get(options, workerInfo) {
const { data } = options;
Expand Down Expand Up @@ -214,7 +215,12 @@
if (reason === 'io server disconnect') {
socket.connect();
}
update('_');
update({
type: 'connection',
data: {
type: 'disconnected'
}
});
});
};
app.events.configure = (data) => {
Expand Down
1 change: 0 additions & 1 deletion uwBridge/system/compile/build/worker/coreBundle.js.map

This file was deleted.

7 changes: 5 additions & 2 deletions uwBridge/system/compile/source/front/core/watchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ export class Watcher {
if (!Watcher.status || !json) {
return;
}
const type = json.type;
const {
type,
name: dataName
} = json;
const levelObject = Watcher.containerPrimary[type] || Watcher.containerPrimary[json.name];
await eachAsync(Watcher.containerRegex, async (watcher) => {
if (watcher.regex.test(type)) {
if (watcher.regex.test(type) || watcher.regex.test(dataName)) {
return watcher(json);
}
});
Expand Down
20 changes: 10 additions & 10 deletions uwBridge/system/compile/source/worker/core/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ const request = async (configObj) => {
const socketIsReady = (data) => {
console.log('Socket Is Ready');
if (alreadySetup) {
update('_', {
type: 'connection.reconnected',
data: {}
update({
type: 'connection',
data: {
type: 'reconnected'
}
});
} else {
post('ready', {
Expand Down Expand Up @@ -150,10 +152,6 @@ const getCallback = async function(jsonData, configObj, workerInfo) {
}
return false;
};
/*
This async streams required filesLoadedfrom socket
or from cache.
*/
assign(app.events.socket, {
async get(options, workerInfo) {
const { data } = options;
Expand Down Expand Up @@ -203,9 +201,11 @@ const socketInitialize = () => {
if (reason === 'io server disconnect') {
socket.connect();
}
update('_', {
type: 'connection.disconnected',
data: {}
update({
type: 'connection',
data: {
type: 'disconnected'
}
});
});
};
Expand Down
2 changes: 2 additions & 0 deletions uwBridge/system/setup/service/socket/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module.exports = (utility) => {
const socketio = require('socket.io');
// const uWS = require('../uWebSockets');
// const { StringDecoder } = require('string_decoder');
const {
each,
eachObject,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 56afe00

Please sign in to comment.