Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Handle exit and shutdown request #76

Merged
merged 3 commits into from
Apr 9, 2018
Merged

Conversation

faustinoaq
Copy link
Member

@faustinoaq faustinoaq commented Apr 9, 2018

Fixes #69 and replaces #70

/cc @damieng

* Add shutdown class_property to check if shutdown has been triggered
* Add dispatch_request(params : Nil, msg) to handle exit and shutdown
* Rename CamelCased methods on context.cr to follow crystal code style
@faustinoaq faustinoaq requested a review from a team April 9, 2018 07:39
@faustinoaq
Copy link
Member Author

#75 already cover an spec for this 👍

if msg.method == "shutdown"
Scry.shutdown = true
ResponseMessage.new(msg.id, nil)
elsif msg.method == "exit"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the 'exit' handling needs to be in dispatch_notification as it is a notification message not a request message (unlike shutdown which is in the correct place)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yeah, Thank you!

@damieng
Copy link

damieng commented Apr 9, 2018

Looks good to me.

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

Successfully merging this pull request may close these issues.

4 participants