Package org.zeromq

# Class ZDispatcher

java.lang.Object
org.zeromq.ZDispatcher

public class ZDispatcher extends Object
Dispatcher for ZeroMQ Sockets. Warning: The Dispatcher uses a busy spin loop when waiting on events. This is ideal for low latency applications but not in all situations. It has the side effect of consuming 100% of a CPU when waiting for events. With this dispatcher, you can register ONE handler per socket and get a Sender for sending ZMsg.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static interface`
`ZDispatcher.ZMessageHandler`
`static final class`
`ZDispatcher.ZSender`

## Constructor Summary

Constructors
Constructor
Description
`ZDispatcher()`
`ZDispatcher(ExecutorService dispatcherExecutor)`

## Method Summary

Modifier and Type
Method
Description
`void`
`registerHandler(ZMQ.Socket socket, ZDispatcher.ZMessageHandler messageHandler, ZDispatcher.ZSender sender)`
`void`
`registerHandler(ZMQ.Socket socket, ZDispatcher.ZMessageHandler messageHandler, ZDispatcher.ZSender sender, ExecutorService threadpool)`
`void`
`shutdown()`
`void`
`unregisterHandler(ZMQ.Socket socket)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ZDispatcher

public ZDispatcher()

### ZDispatcher

public ZDispatcher(ExecutorService dispatcherExecutor)

## Method Details

### registerHandler

public void registerHandler(ZMQ.Socket socket, ZDispatcher.ZMessageHandler messageHandler, ZDispatcher.ZSender sender)

### registerHandler

public void registerHandler(ZMQ.Socket socket, ZDispatcher.ZMessageHandler messageHandler, ZDispatcher.ZSender sender, ExecutorService threadpool)

### unregisterHandler

public void unregisterHandler(ZMQ.Socket socket)

### shutdown

public void shutdown()