Commit Graph

13 Commits

Author SHA1 Message Date
Guangcong Luo
6a32e53890 Forward team validator crashes to main process 2019-01-11 00:41:49 -06:00
Guangcong Luo
6424bd5e72 Forward battle process crashes to main process
This makes it so battle process crashes now appear in the Dev room,
instead of failing more silently.

This should also help them be easier to debug.
2019-01-07 20:15:17 -06:00
Guangcong Luo
43dc92f652 Make ProcessManager slightly safer 2018-10-22 15:45:23 -05:00
Guangcong Luo
c934c04bbc Fix bug in previous commit 2018-10-20 17:55:54 -05:00
Guangcong Luo
4e9ad4e373 Handle process crashes slightly more gracefully 2018-10-20 17:45:17 -05:00
Quinton Lee
94016f6218 Update Typescript to 3.1 (#4879) 2018-10-05 04:02:54 -05:00
MacChaeger
82c792f82c Update to TypeScript 3.0.1 (#4710) 2018-08-07 03:27:28 +09:00
Guangcong Luo
e6cc393109 Fix unused variable in ProcessManager 2018-01-23 07:45:03 -06:00
Guangcong Luo
0c2d712540 Fix Process Manager releasing
This now makes processWrapper.release() a lot more consistent about
actually releasing a process.
2018-01-21 11:37:30 -06:00
Guangcong Luo
2ea6f39876 Fix Process Manager default respawn
Now calling respawn() without any arguments will respawn the same
number of processes currently running.
2018-01-21 11:37:30 -06:00
Guangcong Luo
6c10e3ade4 Fix stream destroying
This should correctly fix the memory leak in subprocess streams.
2018-01-18 20:25:28 -06:00
Guangcong Luo
43103f98ae Disable ProcessManager in tests 2018-01-18 04:10:19 -06:00
Guangcong Luo
ab1f995daa Rewrite Process Manager
Process Manager is now lib/process-manager.js

It's been entirely rewritten to reflect what I think a process manager
API should look like.

In particular, there are now two Process Managers, QueryProcessManager
and StreamProcessManager.

Pass QueryProcessManager a pure-ish query function (sync or async) that
takes a JSON value and returns a JSON value, and PM.query() will
execute that function in a subprocess, and return a Promise for its
return value.

StreamProcessManager is the same idea: Pass it a function to create an
ObjectReadWriteStream, and PM.createStream() will create a stream in a
subprocess and return a stream connected to it.
2018-01-18 03:34:16 -06:00