Merge lp:~allenap/gwacl/poll-immediately into lp:gwacl
Proposed by
Gavin Panella
Status: | Merged |
---|---|
Approved by: | Gavin Panella |
Approved revision: | 155 |
Merged at revision: | 155 |
Proposed branch: | lp:~allenap/gwacl/poll-immediately |
Merge into: | lp:gwacl |
Diff against target: |
66 lines (+29/-4) 2 files modified
poller.go (+19/-4) poller_test.go (+10/-0) |
To merge this branch: | bzr merge lp:~allenap/gwacl/poll-immediately |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raphaël Badin (community) | Approve | ||
Review via email: mp+172567@code.launchpad.net |
Commit message
In performPolling, do an immediate poll before sleeping.
To post a comment you must log in.
Looks okay, I think it's much harder to follow what's going on now but I don't think it's worth blocking you (although I'm tempted :))
That code is not very readable (especially the new internal poll() method that returns a bool *and* modifies performPolling- level objects)! Part of it, I reckon, is not your fault but is related to the way Go works… but I still wonder if this cannot be improved a tad.
[0]
19 + // Do a single poll, checking for timeout.
20 + poll := func() bool {
Please explain what the returned boolean means.
[1]
20 + poll := func() bool {
Could poll be changed so that it would not modify 'response' and 'err' "in place". That is really confusing, at least to me.
[2]
14 + defer func() {
15 + if err != nil {
16 + response = nil
17 + }
18 + }()
Why did you add that? I suspect it is because an old response from polling number n might be returned along with an error that appended during poll number n+1… please put a comment to explain what purpose this serves.