| 53 | }; |
| 54 | |
| 55 | ACTOR void sendCommitReply(IKVSCommitRequest commitReq, IKeyValueStore* kvStore, Future<Void> onClosed) { |
| 56 | try { |
| 57 | choose { |
| 58 | when(wait(onClosed)) { commitReq.reply.sendError(remote_kvs_cancelled()); } |
| 59 | when(wait(kvStore->commit(commitReq.sequential))) { |
| 60 | StorageBytes storageBytes = kvStore->getStorageBytes(); |
| 61 | commitReq.reply.send(IKVSCommitReply(storageBytes)); |
| 62 | } |
| 63 | } |
| 64 | } catch (Error& e) { |
| 65 | TraceEvent(SevDebug, "RemoteKVSCommitReplyError").errorUnsuppressed(e); |
| 66 | commitReq.reply.sendError(e.code() == error_code_actor_cancelled ? remote_kvs_cancelled() : e); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | ACTOR template <class T> |
| 71 | Future<Void> cancellableForwardPromise(ReplyPromise<T> output, Future<T> input) { |
no test coverage detected