@rip-lang/server 0.6.0 → 0.6.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.rip +9 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rip-lang/server",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Pure Rip application server — multi-worker, hot reload, HTTPS, mDNS",
5
5
  "type": "module",
6
6
  "main": "server.rip",
package/server.rip CHANGED
@@ -557,6 +557,15 @@ class Manager
557
557
 
558
558
  Promise.all!(pairs.map(({ old }) -> old.process.exited.catch(-> null)))
559
559
 
560
+ # Notify server to remove old workers' socket entries
561
+ ctl = getControlSocketPath(@flags.socketPrefix)
562
+ for { old } in pairs
563
+ try
564
+ body = JSON.stringify({ op: 'quit', workerId: old.id })
565
+ fetch!('http://localhost/worker', { method: 'POST', body, headers: { 'content-type': 'application/json' }, unix: ctl }).catch(-> null)
566
+ catch
567
+ null
568
+
560
569
  retiring = new Set(pairs.map((p) -> p.old.id))
561
570
  @workers = @workers.filter((w) -> not retiring.has(w.id))
562
571
  @retiringIds.delete(id) for id from retiring