Skip to content
This repository has been archived by the owner on Aug 3, 2019. It is now read-only.

Getting Started

Mark Paluch edited this page Feb 18, 2016 · 2 revisions

You can get started with spinach in various ways.

1. Get it

For Maven users:

Add these lines to file pom.xml:

<dependency>
    <groupId>biz.paluch.redis</groupId>
    <artifactId>spinach</artifactId>
    <version>0.1</version>
</dependency>

For Ivy users:

Add these lines to file ivy.xml:

<ivy-module>
  <dependencies>
    <dependency org="biz.paluch.redis" name="spinach" rev="0.1"/>
  </dependencies>
</ivy-module>

For Gradle users:

Add these lines to file build.gradle:

dependencies {
  compile 'biz.paluch.redis:spinach:0.1'
}

Plain Java

Download the latest binary package from https://github.com/mp911de/spinach/releases and extract the archive

2. Start coding

So easy! No more boring routines, we can start.

Import required classes:

import biz.paluch.spinach.*;
import biz.paluch.spinach.api.*;
import biz.paluch.spinach.api.sync.*;
import java.util.concurrent.TimeUnit;

and now, write your code:

DisqueClient disqueClient = DisqueClient.create(DisqueURI.create("disque://password@localhost:7711"));
DisqueCommands<String, String> sync = disqueClient.connect().sync();

sync.addjob("queue", "body", 1, TimeUnit.MINUTES);

Job<String, String> job = sync.getjob("queue");

sync.ackjob(job.getId());

sync.close();
disqueClient.shutdown();

Done!

Do you want to see working examples?