-
Notifications
You must be signed in to change notification settings - Fork 47
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
Move notification struct error checking before queueing it in run loop #17
Conversation
@tylrtrmbl @nathany @brunodecarvalho if anyone has some spare 👀, this should help a bit with #4 |
@bdotdub If it's okay, I might not get to this until next Wednesday. |
Actually, I changed my mind back again from #4. I think it makes sense to use the synchronization and information passing mechanism you have now (a channel of From my perspective, there's no reason I would need to know if the error came from |
What's up with Travis CI by the way? |
Personally I'd prefer Send return errors when it can. But then I'm trying to build a synchronous API around Send and FailedNotifs that gives me back Apple's response or a timeout. |
I've been thinking a lot about this and am feeling like we should have The API feels cleaner to me if I get an |
You're suggesting a synchronous API then? |
Yeah - it'll require a lot less bookkeeping internally and will push that option to the caller. |
Especially since the actually sending is basically synchronous on one tcp connection |
👍 for the synchronous API/pushing that responsibility to the caller. |
👍 For me too, actually. I actually prefer that the caller have granular control over stuff like that. Consider my previous comments as "assuming you wanted to keep it async". Excited to see it now! |
Going to hold off on merging this for now. I've got some code in the hopper that'll fixes up the internals to be less confusing as mentioned here. |
This sounds pretty great and will really help make the API solid. But now I'm waiting for this to magically solve #16 instead of coming up with a solution. |
@bdotdub Pushing some error handling back to user of the library sounds good. Say, if a certificate has expired, it shouldn't continue retrying (I've yet to confirm what the current behaviour is). |
This PR passes back validation and serialization errors synchronously to the caller of
Send()
instead of...well...ignoring it in the run loop or having to read off of another channel.Fixes #4