-
Notifications
You must be signed in to change notification settings - Fork 187
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
Prevent responder from getting new requests #228
Comments
This is a good question. cote currently doesn't support graceful shutdowns, we should add it as a feature. Would you be intrerested in doing it? |
@dashersw I am interested in adding this feature as well. Can you explain to me the best approach to this and I can try to implement? Is this solved in cote or node-discover? |
I think there are two approaches:
both are similar, the first one would be much quicker in terms of execution, the second one would make you wait ~ 3-5 seconds for the discovery mechanism to work. the first one has the downside of augmenting / modifying the client's response object. I don't know however problematic that would be, especially if we strip those messages on the requester before we hand it over to the user's actual callback. Hope this helps! |
Oh, and all of this could be implemented in cote. |
Is this taken care of? I would be happy to help. |
Hi, I'm working on my service to graceful shutdown. How can I prevent responder to accept new requests so it could finish already got ones and then call
responder.close
?I have example responder:
and example requester that make 10 requests:
As I coded responder to close on request with
i === 5
, I lose this request. IMPORTANT NOTE: when I do NOT specify__timeout
in requester, once responder is restarted this request hangs forever.In case when I do NOT call
responder.close
untill all requests are processed I keep getting new requests, so it does not seems like a solution.Thanks in advance.
The text was updated successfully, but these errors were encountered: