@digitalasset/daml-ledger
Version:
DAML Ledger API Node.js bindings
38 lines • 1.21 kB
JavaScript
;
// Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClientCancellableCall = void 0;
class ClientCancellableCall {
constructor(wrapped) {
this.wrapped = wrapped;
}
static accept(wrapped) {
return new ClientCancellableCall(wrapped);
}
/**
* Cancel the ongoing call. Results in the call ending with a CANCELLED status,
* unless it has already ended with some other status.
*/
cancel() {
if (this.wrapped) {
this.wrapped.cancel();
}
}
/**
* Get the endpoint this call/stream is connected to.
*
* @returns {string} The URI of the endpoint or an empty string if the call never reached the server
*/
getPeer() {
if (this.wrapped !== undefined) {
return this.wrapped.getPeer();
}
else {
return '';
}
}
}
exports.ClientCancellableCall = ClientCancellableCall;
ClientCancellableCall.rejected = new ClientCancellableCall();
//# sourceMappingURL=ClientCancellableCall.js.map