class CheramiPublisherImpl implements CheramiPublisher, Reconfigurable {

    @Override
    public synchronized void close() {
        if (isOpen.getAndSet(false)) {
            connectionManager.close();
            while (true) {
                // drain the send buffer queue
                PutMessageRequest msg = messageQueue.poll();
                if (msg == null) {
                    break;
                }
                CheramiFuture<SendReceipt> future = msg.getAckFuture();
                String msgID = msg.getMessage().getId();
                future.setReply(new SendReceipt(msgID, ReceiptStatus.ERR_NO_CONNS, RECEIPT_ERROR_NO_CONNS));
            }
        }
        logger.info("Publisher closed");
    }

    public  CheramiPublisherImpl(CheramiClient client, String path, PublisherOptions options, MetricsReporter reporter);

}