summaryrefslogtreecommitdiff
path: root/reference.go
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2013-05-17 11:38:37 +0200
committerCarlos Martín Nieto <[email protected]>2013-05-23 11:44:06 +0200
commitb189d7919a3d1632cb7869e71c495cede93a74dc (patch)
tree98dfa00b389a2850eacb91d221bdba8c93173fd7 /reference.go
parent4e0a28b064047513194a842e9c16d9beab545f41 (diff)
Allow aborting the pack writing operation
In case of an error in the writer, the packbuilder will stay around waiting for someone to read from its channel. The state associated with a packbuilder is non-trivial and it will keep a reference to the object, so the GC won't be able to free it. Change the ForEach interface to also return a "stop" channel. Closing the channel or writing into it will cause the first receive clause to act, making the callback to return -1, aborting the operation and ending the goroutine, freeing its hold on the packbuilder.
Diffstat (limited to 'reference.go')
0 files changed, 0 insertions, 0 deletions