Skip to content

Commit

Permalink
Log socketio lifecylce for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
u8sand committed Oct 2, 2020
1 parent 5b3a207 commit 1417bbe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions appyter/profiles/default/static/js/landing.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"import sys\n",
"import time\n",
"for n in range(10):\n",
" time.sleep(0.5)\n",
" time.sleep(10)\n",
" print('\\r', n, end='')"
]
},
Expand Down
9 changes: 8 additions & 1 deletion js/profiles/default/static/js/landing.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
if (_deps === undefined) {
_deps = await new Promise(
(resolve, reject) =>
window.require(['socket'], function (socket, SocketIOFileUpload) {
window.require(['socket'], function (socket) {
resolve({ socket })
}, reject)
)
Expand Down Expand Up @@ -70,9 +70,16 @@
async function setup_async_exec() {
socket.on('connect', async () => {
console.log('connect')
const paths = window.location.pathname.split('/').filter(p => p)
socket.emit('join', paths[paths.length - 1])
})
socket.on('reconnect', async () => {
console.log('reconnect')
})
socket.on('disconnect', async () => {
console.log('disconnect')
})
socket.on('status', async (value) => {
await tick()
status = value
Expand Down

0 comments on commit 1417bbe

Please sign in to comment.