Feature request: voluntarily server termination #4

Closed
opened 2024-03-04 22:47:52 +00:00 by ehmry · 5 comments

#2 poses the question if the syndicate-server should ever terminate voluntarily. I would like to instruct the server to terminate in the case of testing. I would run an instance of the server after building some programs and configuration, use it to run my programs that produce some output, and then terminate cleanly. I could do this with a long-running init server but I want everything contained within my build system which has an additive-only build graph and I don't want to stop a test by modifying or removing a file once it's been written.

I imagine that termination would be in response to an assertion or message to $config like <exit @code int>.

This is a strange request but I've found it helpful for testing recursive init systems. It might also make it possible to use the server as a hacky, reactive, declarative alternative to running a shell script.

#2 poses the question if the syndicate-server should ever terminate voluntarily. I would like to instruct the server to terminate in the case of testing. I would run an instance of the server after building some programs and configuration, use it to run my programs that produce some output, and then terminate cleanly. I could do this with a long-running init server but I want everything contained within my build system which has an additive-only build graph and I don't want to stop a test by modifying or removing a file once it's been written. I imagine that termination would be in response to an assertion or message to `$config` like `<exit @code int>`. This is a strange request but I've found it helpful for testing recursive init systems. It might also make it possible to use the server as a hacky, reactive, declarative alternative to running a shell script.
Author

Modifying the server could be avoided with a shim that would start the syndicate-server as an inferior and only speak enough of the protocol to kill the server and itself on an exit message.

Modifying the server could be avoided with a shim that would start the syndicate-server as an inferior and only speak enough of the protocol to kill the server and itself on an exit message.
Owner

I like the idea! The shim idea is fine, but seems fiddly; I think, at least for now, a simple message as you suggest would be enough. But instead of sending to $config, perhaps there should be a new variable like $control or similar?

I like the idea! The shim idea is fine, but seems fiddly; I think, at least for now, a simple message as you suggest would be enough. But instead of sending to `$config`, perhaps there should be a new variable like `$control` or similar?
Owner

How does #5 look as a solution?

How does #5 look as a solution?
Author

This is what I want, and I agree that a separate control entity is better than config.

This is what I want, and I agree that a separate control entity is better than config.
Owner

Cool. Resolved by #5

Cool. Resolved by #5
tonyg closed this issue 2024-03-07 12:24:35 +00:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: syndicate-lang/syndicate-rs#4
No description provided.