[services] Backup/Blob - Add terminateCallback
Summary:
Depends on D3559
We want to add an additional callback that will be executed before the connection ends but after we are done with the communication.
From now on we will have two "ending" callbacks:
- doneCallback - this is executed after the connection ends and there will be no more grpc operations in the current context
- terminateCallback - this is executed when we're done with the communication but we have not yet closed the connection
The reason to introduce the termination callback is that I needed to wait until the backup client work is done before I closed the connection from backup with the client. Having this, we are able to tell when the whole backup operation is done, without it we only knew when the communication between the client and the backup was done(plus the chunks were sent to the blob but we wouldn't know what happened to them after that).
Test Plan:
cd services yarn run-backup-service
Reviewers: varun, jimpo, palys-swm, geekbrother
Reviewed By: palys-swm
Subscribers: ashoat, palys-swm, Adrian, atul, benschac, yayabosh
Differential Revision: https://phabricator.ashoat.com/D3560