class ScribeSender implements EventSender {

    @Override
    public void send(final File file, final CallbackHandler handler)
    {
        if (isClosed.get()) {
            createConnection();
        }

        // Tell the watchdog that we are doing something
        sleeping.set(false);

        // Parse the underlying file and generate the payload for Scribe
        final List<LogEntry> list = createScribePayload(file, handler);
        if (list == null) {
            // Something went wrong
            return;
        }

        try {
            scribeClient.log(list);
            // Get rid of the file. We do it early, because the reconnection may fail
            handler.onSuccess(file);

            messagesSuccessfullySent.addAndGet(list.size());
            messagesSuccessfullySentSinceLastReconnection.addAndGet(list.size());

            // For load balancing capabilities, we don't want to make sticky connections to Scribe.
            // After a certain threshold, force a refresh of the connection.
            if (messagesSuccessfullySentSinceLastReconnection.get() > messagesToSendBeforeReconnecting) {
                log.info("Recycling connection with Scribe");
                messagesSuccessfullySentSinceLastReconnection.set(0);
                createConnection();
            }
        }
        catch (org.apache.thrift.TException e) {
            // Connection flacky?
            log.warn("Error while sending message to Scribe: {}", e.getLocalizedMessage());
            createConnection();
            handler.onError(new Throwable(e), file);
        }
    }

    public  ScribeSender(final ScribeClient scribeClient, final int messagesToSendBeforeReconnecting, final int maxIdleTimeInMinutes);

}