Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow RestartingServer behavior to be configured #15

Open
jbromberg opened this issue Jan 17, 2024 · 3 comments
Open

Allow RestartingServer behavior to be configured #15

jbromberg opened this issue Jan 17, 2024 · 3 comments

Comments

@jbromberg
Copy link

Would be nice to support behavior for how the RestartingServer restarts.

Currently, there's a 5 second cooldown hardcoded in:

try? await Task.sleep(nanoseconds: 5 * NSEC_PER_SEC)

Possible idea:

enum RestartBehavior {
    case nextRequest
    case afterCooldown(seconds: Int)
}
@jbromberg
Copy link
Author

This might be worthy of a separate issue, but it may also be helpful to allow a closure to be executed when the server restarts. you may want to send the server a didOpen notification or do some other work.

@mattmassicotte
Copy link
Contributor

Can you elaborate on what you want to send the server? Its state should be transparently restored when it is started back up. For example, any open documents are automatically re-opened.

@jbromberg
Copy link
Author

It seems like open docs are re-opened only when the server state is set to restartNeeded but I don't see anywhere that it would reach this state. When calling connectionInvalidated() the server state gets set to notStarted after 5 seconds which doesn't reopen docs upon reconnecting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants