/ladder

A fast, simple persistent queue written in Java

Primary LanguageJavaMIT LicenseMIT

Ladder

GitHub Total Alerts Code Quality: Java

Introduction

Ladder is a lightning fast persistent queue written in Java.

Usage

Installation

// TODO publish to Maven Central

Create persistent queue instance

String path = "/path/to/your/queue/dir";
        Queue queue = new LadderQueue(
        new File(path),
        LadderQueueOptions.builder()
        .dataFlushThreshold(512 * 1024)
        .maxFileSize(100 * 1024)
        .build()
);

Basic operations

put

byte[] data = new byte[] {...};
queue.put(data);

take

byte[] read = queue.take();

poll

long timeoutInMs = 500;
byte[] read = queue.poll(timeoutInMs);