Stopping the server
See original GitHub issueFirst and foremost: keep up the good work, i like where this project is going (:
I tried to implement an fs.watch logic that restarts oak on file change. For this I added the AbortController as mentioned in the README and I added controller.abort()
to my fs.watch. Unfortunately neither the promise from app.listen was ever resolved, nor was the underlying server closed - it also seems like server.close()
is not called in https://github.com/oakserver/oak/blob/master/application.ts#L226
Do I misunderstand the idea behind the AbortController? Or is this just not fully implemented?
Issue Analytics
- State:
- Created 3 years ago
- Comments:13
Top Results From Across the Web
Stopping the server - IBM
When you issue the HALT command to stop the server, the following actions occur: All processes and client node sessions are canceled. All...
Read more >Stop the server from the Windows command prompt
Stop the server from the Windows command prompt · Open another Windows command prompt. Click Start > Programs > Accessories > Command Prompt....
Read more >Starting, stopping, and restarting Application Servers
To stop all Application Servers on the host · (Windows) Do one of the following: From the command line window where the Application...
Read more >Starting and Stopping the Application Server
4. Depending on the server instance's state, click either the Start or Stop button to either start or stop the application server instance....
Read more >server stop command :: Open Liberty Docs
The server stop command stops the named Open Liberty server. Normal server stop includes a quiesce stage before the server shuts down. This...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, sorry folks. I think I fixed it in 4bc2c76cad7e3ffed3725e29dedbbd0d5b7e3925. It was a situation where it needed to process another request to actually close the server. I had run into an issue where if you were processing middleware (like you abort in middleware) it caused all sorts of carnage, so I didn’t do that, but then it did mean that it wouldn’t see that close until too late. Now it tracks if it handling requests, and if it isn’t it will close, which should resolve the promise, otherwise it will finish any in flight requests before closing. I need a better test “mock” as my current one is limited, and giving me a false sense of fixing the problem.
Quick question on this topic: why not just have an
app.close
method? It could encapsulate the abort controller and make it easy/easier to use.