Wraps a readable to make it time out when nothing is read for a certain amount of time.
The readable to wrap
The lock for the corresponding identifier.
Wraps a representation to make it time out when nothing is read for a certain amount of time.
The representation to wrap
The lock for the corresponding identifier.
Acquires a lock for the identifier that should return a representation with Readable data and releases it when the Readable is read, closed or results in an error. When using this function, it is required to close the Readable stream when you are ready.
Identifier that should be locked.
Function to be executed.
Acquires a lock for the identifier and releases it when the function is executed.
Identifier that should be locked.
Function to be executed.
Store that for every call acquires a lock before executing it on the requested resource, and releases it afterwards.