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

Myriad of changes #9

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

danjenkins
Copy link
Contributor

@danjenkins danjenkins commented Nov 13, 2019

Allow Simringer class users access to events

Also make the event names relevant. finalFailure is not the finalFailure for the simringer as a whole, Also added data for the events. finalSuccess will tell you which uri was successful. failure will tell you the err and the uri in an obj

allow external application to cancel simringer

designed so that the simringer no longer handles its own timesouts, and no longer tracks failures
as a way of rejecting the final promise. Pass in timeout as null or false, and listen for the relevant events and decide on when you want to terminate the simringer yourself

dont clear whole map, delete each uri

other code in _attemptOne calls killCalls and then removes a uri from the Map afterwards
This proves that you expect the URI to still be in the map. Instead of clearing (because one could still be in there), delete them individually

Also some whitespace changes to follow the conventions in the file

Currently untested so submitting as a draft to see what you think of the changes

Also make the event names relevant.
finalFailure is not the finalFailure for the
simringer as a whole, also added data for the events
finalSuccess will tell you which uri was successful
failure will tell you the err and the uri in an obj
designed so that the simringer no longer handles
its own timesouts, and no longer tracks failures
as a way of rejecting the final promise.

Pass in timeout as null or false, and listen
for the relevant events and decide on when you
want to terminate the simringer yourself
other code in _attemptOne calls killCalls
and then removes a uri from the Map afterwards
This proves that you expect the URI to still be in
the map. Instead of clearing
(because one could still be in there), delete them individually
@@ -47,7 +49,7 @@ function transfer(opts) {
return referHandler.transfer();
}

class Simring {
class Simring extends Emitter{
constructor(req, res, uriList, opts, notifiers) {
const callOpts = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't you need to call super() as the first thing in the constructor?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you're probably 100% right here :) Like I said - completely non tested. I'll go test the changes myself this week and we can go from there

@davehorton
Copy link
Collaborator

It looks pretty good to me from a quick review, but my main thought is that I really need to create a comprehensive test suite for this package because things are getting complex and probably now is the time to create a 100% test suite that we can update going forward. Otherwise, I'm not sure we can have confidence that future changes aren't breaking things.

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

Successfully merging this pull request may close these issues.

2 participants