(
sid: SessionId,
transportName: string,
lockType: "read" | "write",
onSuccess: (senderId: NodeId) => void,
onError: () => void,
)
| 431 | } |
| 432 | |
| 433 | private _acquireLock( |
| 434 | sid: SessionId, |
| 435 | transportName: string, |
| 436 | lockType: class="st">"read" | class="st">"write", |
| 437 | onSuccess: (senderId: NodeId) => void, |
| 438 | onError: () => void, |
| 439 | ) { |
| 440 | const requestId = ++this._requestCount as RequestId; |
| 441 | |
| 442 | const timer = setTimeout(() => { |
| 443 | this._requests.delete(requestId); |
| 444 | onError(); |
| 445 | }, this._opts.responseTimeout); |
| 446 | |
| 447 | this._requests.set(requestId, { |
| 448 | timer, |
| 449 | onSuccess, |
| 450 | onError, |
| 451 | }); |
| 452 | |
| 453 | this.publishMessage({ |
| 454 | requestId, |
| 455 | senderId: this._nodeId, |
| 456 | type: MessageType.ACQUIRE_LOCK, |
| 457 | data: { |
| 458 | sid, |
| 459 | transportName, |
| 460 | type: lockType, |
| 461 | }, |
| 462 | }); |
| 463 | } |
| 464 | |
| 465 | private _hookTransport( |
| 466 | sid: SessionId, |
nothing calls this directly
no test coverage detected