Lines Matching full:transfer

28   Transfer,
30 } from './transfer';
33 [key: number]: Transfer;
47 * When created, a Manager starts a separate thread in which transfer
64 * @param{ServiceClient} service: the pw_rpc transfer service
69 * be longer to account for transfer handler initialization
82 * @throws Throws an error when the transfer fails to complete.
90 `Read transfer for resource ${resourceId} already exists`,
93 const transfer = new ReadTransfer( constant
101 this.startReadTransfer(transfer);
103 const status = await transfer.done;
105 delete this.readTransfers[transfer.id];
107 throw new TransferError(transfer.id, transfer.status);
109 return transfer.data;
112 /** Begins a new read transfer, opening the stream if it isn't. */
113 startReadTransfer(transfer: Transfer): void {
114 this.readTransfers[transfer.id] = transfer;
119 console.debug(`Starting new read transfer ${transfer.id}`);
120 transfer.begin();
134 const transfer = new WriteTransfer( constant
143 this.startWriteTransfer(transfer);
145 const status = await transfer.done;
147 delete this.writeTransfers[transfer.id];
148 if (transfer.status !== Status.OK) {
149 throw new TransferError(transfer.id, transfer.status);
161 /** Begins a new write transfer, opening the stream if it isn't */
162 startWriteTransfer(transfer: Transfer): void {
163 this.writeTransfers[transfer.id] = transfer;
169 console.debug(`Starting new write transfer ${transfer.id}`);
170 transfer.begin();
210 // server resets during an active transfer. Re-open the stream to
222 const transfer = this.readTransfers[key]; constant
223 transfer.abort(Status.INTERNAL);
233 // server resets during an active transfer. Re-open the stream to
243 const transfer = this.writeTransfers[key]; constant
244 transfer.abort(Status.INTERNAL);
254 * The chunk is dispatched to an active transfer based on its ID. If the
255 * transfer indicates that it is complete, the provided completion callback
259 const transfer = transfers[chunk.getTransferId()]; constant
260 if (transfer === undefined) {
262 `TransferManager received chunk for unknown transfer ${chunk.getTransferId()}`,
266 transfer.handleChunk(chunk);
271 * Exception raised when a transfer fails.
273 * Stores the ID of the failed transfer and the error that occured.
280 super(`Transfer ${id} failed with status ${Status[status]}`);