Merge lp:~robru/friends/async into lp:friends
Status: | Merged |
---|---|
Approved by: | Ken VanDine |
Approved revision: | 86 |
Merged at revision: | 84 |
Proposed branch: | lp:~robru/friends/async |
Merge into: | lp:friends |
Diff against target: |
267 lines (+158/-15) 4 files modified
friends/protocols/facebook.py (+19/-7) friends/service/dispatcher.py (+47/-2) friends/tests/test_dispatcher.py (+20/-0) friends/tests/test_facebook.py (+72/-6) |
To merge this branch: | bzr merge lp:~robru/friends/async |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ken VanDine | Approve | ||
Review via email: mp+137696@code.launchpad.net |
Description of the change
Hey Ken,
so this mostly looks like it's working, and I've added test coverage to it, however be aware that I have not actually *used* this to upload any *real* files to confirm that it *actually* works, so you should probably do that ;-)
One problem I foresee is that the upload code is raising exceptions in some places (eg, like if the client passes in a path instead of a URI, or if the URI does not refer to an existing file), and those exceptions are swallowed up and logged by the threading logic, which means there are scenarios in which neither the success nor the failure callback are ever called. We might want to catch all exceptions and then make sure that the failure callback is called, but I didn't have time for that right now because I am on my way out for lunch.
Let me know what you think of it so far and then when I get back I can clean it up to your liking.
But mostly let me know if it even works ;-)
Alright Ken, I fixed up that exception stuff I was talking about, so now it should always call either the success or failure callbacks no matter what. Let me know if you can think of any conditions for which this isn't true, but I think it's good.
With your approval of this approach, I'll begin adding success/failure callbacks to most other things.
In fact, we should probably find some way of merging the logging code into the failure callbacks, since there's going to be a *ton* of overlap between calls to failure() and calls to log.error().