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
Added MemoryStore shutdown method #322
Added MemoryStore shutdown method #322
Conversation
Thank you for taking the time to make this PR, this looks great! Could you please also add the shutdown method to the |
That's a good idea! We should make it optional, though I don't want other stores to be required to implement it. Also, it should probably be |
Can do. Something like this?
|
This is great! Sorry I didn't mention this earlier, but I think we should add an external test for this too - adding a shutdown method that prints 'Shutdown successful' (to the store here) and call the function when a request is received (here); and then make the same changes to this file too. We should also add documentation about the shutdown method to the wiki. After that, this PR should be good to go! |
Do we need the |
@gamemaker1 Of course.
I'm not sure I understand. Call the
The |
Oof I realise that's really silly to do, sorry about that. I think a better way would be:
You would also need to do the same for the
Please keep the |
This looks good to go! @nfriedly what do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is great work! Sorry I've been out of the loop for a couple of days.
I think we should make the test call expect(setTimeout).toHaveBeenCalledWith(...);
but the other things I mentioned are minor points that don't necessarily need to be changed.
if (store instanceof TestStore) | ||
expect(console.log).toHaveBeenCalledWith('Shutdown successful') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these console.log tests don't really seem necessary to me, but I know it was @gamemaker1's request and I guess it's not really hurting anything either. 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this is a good addition! I'll get a release out shortly.
Related Issues
Fixes #320
What Does This PR Do?
Added
Added
MemoryStore.shutdown
which clears the timer and allows applications to completely stop a running instance of MemoryStore.Checklist
npm test
) pass.methods/classes/constants/types have been annotated with TSDoc comments.
added for the same.