mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 12:11:47 +00:00
add zmq.Socket.pause and zmq.Socket.resume
This commit is contained in:
@@ -42,3 +42,12 @@ function test5() {
|
||||
sock.monitor();
|
||||
sock.monitor(10);
|
||||
}
|
||||
|
||||
function test6() {
|
||||
var sock = zmq.socket(zmq.types.dealer);
|
||||
sock.bind('tcp://127.0.0.1', err => {
|
||||
sock.send("some work");
|
||||
});
|
||||
sock.pause();
|
||||
sock.resume();
|
||||
}
|
||||
|
||||
Vendored
+13
@@ -184,6 +184,19 @@ declare module 'zmq' {
|
||||
*/
|
||||
on(eventName: string, callback: (...buffer: Buffer[]) => void): void;
|
||||
|
||||
/**
|
||||
* Set socket to pause mode
|
||||
* no data will be emit until resume() is called
|
||||
* all send() calls will be queued
|
||||
*/
|
||||
pause(): void;
|
||||
|
||||
/**
|
||||
* Set a socket back to normal work mode
|
||||
* triggers a _flushReads and _flushWrites
|
||||
*/
|
||||
resume(): void;
|
||||
|
||||
// Socket Options
|
||||
_fd: any;
|
||||
_ioevents: any;
|
||||
|
||||
Reference in New Issue
Block a user