-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.html
More file actions
28 lines (25 loc) · 803 Bytes
/
index.html
File metadata and controls
28 lines (25 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<script type="module" src="../../dist/index.js"></script>
<script id="terminal" type="micropython" worker>
from polyscript import xworker
is_stuck = xworker.sync.isStuck
not_stuck = xworker.sync.notStuck
def unstuck(condition):
if condition and is_stuck():
not_stuck()
raise RuntimeError('Worker is stuck')
return condition
while unstuck(True):
import time
time.sleep(1)
print('stuck in a loop')
</script>
</head>
<body>
<button onclick="terminal.xworker.unstuck()">Unstuck</button>
</body>
</html>