New begin/finish interface. Not yet wired.

geesefs-0-30-9
Aaron Jacobs 2015-05-05 10:14:54 +10:00
parent be24b2b3e3
commit 365f219704
1 changed files with 11 additions and 3 deletions

View File

@ -85,13 +85,21 @@ func (c *Connection) log(
c.logger.Println(msg)
}
// Set up state for an op that is about to be returned to the user.
func (c *Connection) beginOp() {
// Set up state for an op that is about to be returned to the user, given its
// bazilfuse request ID.
//
// Return a context that should be used for the op.
func (c *Connection) beginOp(reqID bazilfuse.RequestID) (ctx context.Context) {
c.opsInFlight.Add(1)
// TODO(jacobsa): Use WithCancel and stash a cancellation function.
ctx = c.parentCtx
return
}
// Clean up all state associated with an op to which the user has responded.
func (c *Connection) finishOp() {
func (c *Connection) finishOp(reqID bazilfuse.RequestID) {
c.opsInFlight.Done()
}