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

Commit

Permalink
Fix addjob documentation about timeout/TTL #21
Browse files Browse the repository at this point in the history
  • Loading branch information
mp911de committed Jan 4, 2016
1 parent e0932b8 commit cee5bdb
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,24 @@ public interface DisqueJobAsyncCommands<K, V> {
*
* @param queue the queue name
* @param job job body
* @param timeout TTL timeout
* @param timeUnit TTL timeout time unit
* @param commandTimeout command timeout to reach replication level
* @param timeUnit command timeout unit
* @return the job id
*/
RedisFuture<String> addjob(K queue, V job, long timeout, TimeUnit timeUnit);
RedisFuture<String> addjob(K queue, V job, long commandTimeout, TimeUnit timeUnit);

/**
*
* Add a job to the {@code queue} with the body {@code job}.
*
* @param queue the queue name
* @param job job body
* @param timeout TTL timeout
* @param timeUnit TTL timeout time unit
* @param commandTimeout command timeout to reach replication level
* @param timeUnit command timeout unit
* @param addJobArgs additional job arguments
* @return the job id
*/
RedisFuture<String> addjob(K queue, V job, long timeout, TimeUnit timeUnit, AddJobArgs addJobArgs);
RedisFuture<String> addjob(K queue, V job, long commandTimeout, TimeUnit timeUnit, AddJobArgs addJobArgs);

/**
* Evict (and possibly remove from queue) all the jobs in memeory matching the specified job IDs. Jobs are evicted whatever
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,24 @@ public interface DisqueJobReactiveCommands<K, V> {
*
* @param queue the queue name
* @param job job body
* @param timeout TTL timeout
* @param timeUnit TTL timeout time unit
* @param commandTimeout command timeout to reach replication level
* @param timeUnit command timeout unit
* @return the job id
*/
Observable<String> addjob(K queue, V job, long timeout, TimeUnit timeUnit);
Observable<String> addjob(K queue, V job, long commandTimeout, TimeUnit timeUnit);

/**
*
* Add a job to the {@code queue} with the body {@code job}.
*
* @param queue the queue name
* @param job job body
* @param timeout TTL timeout
* @param timeUnit TTL timeout time unit
* @param commandTimeout command timeout to reach replication level
* @param timeUnit command timeout unit
* @param addJobArgs additional job arguments
* @return the job id
*/
Observable<String> addjob(K queue, V job, long timeout, TimeUnit timeUnit, AddJobArgs addJobArgs);
Observable<String> addjob(K queue, V job, long commandTimeout, TimeUnit timeUnit, AddJobArgs addJobArgs);

/**
* Evict (and possibly remove from queue) all the jobs in memeory matching the specified job IDs. Jobs are evicted whatever
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/biz/paluch/spinach/api/sync/DisqueJobCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,24 @@ public interface DisqueJobCommands<K, V> {
*
* @param queue the queue name
* @param job job body
* @param timeout TTL timeout
* @param timeUnit TTL timeout time unit
* @param commandTimeout command timeout for replication
* @param timeUnit command timeout unit
* @return the job id
*/
String addjob(K queue, V job, long timeout, TimeUnit timeUnit);
String addjob(K queue, V job, long commandTimeout, TimeUnit timeUnit);

/**
*
* Add a job to the {@code queue} with the body {@code job}.
*
* @param queue the queue name
* @param job job body
* @param timeout TTL timeout
* @param timeUnit TTL timeout time unit
* @param commandTimeout command timeout to reach replication level
* @param timeUnit command timeout unit
* @param addJobArgs additional job arguments
* @return the job id
*/
String addjob(K queue, V job, long timeout, TimeUnit timeUnit, AddJobArgs addJobArgs);
String addjob(K queue, V job, long commandTimeout, TimeUnit timeUnit, AddJobArgs addJobArgs);

/**
* Evict (and possibly remove from queue) all the jobs in memeory matching the specified job IDs. Jobs are evicted whatever
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ public RedisFuture<Long> ackjob(String... jobIds) {
}

@Override
public RedisFuture<String> addjob(K queue, V job, long duration, TimeUnit timeUnit) {
return dispatch(commandBuilder.addjob(queue, job, duration, timeUnit, null));
public RedisFuture<String> addjob(K queue, V job, long commandTimeout, TimeUnit timeUnit) {
return dispatch(commandBuilder.addjob(queue, job, commandTimeout, timeUnit, null));
}

@Override
public RedisFuture<String> addjob(K queue, V job, long duration, TimeUnit timeUnit, AddJobArgs addJobArgs) {
return dispatch(commandBuilder.addjob(queue, job, duration, timeUnit, addJobArgs));
public RedisFuture<String> addjob(K queue, V job, long commandTimeout, TimeUnit timeUnit, AddJobArgs addJobArgs) {
return dispatch(commandBuilder.addjob(queue, job, commandTimeout, timeUnit, addJobArgs));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public Command<K, V, Long> ackjob(String[] jobIds) {
return createCommand(ACKJOB, new IntegerOutput<K, V>(codec), args);
}

public Command<K, V, String> addjob(K queue, V job, long duration, TimeUnit timeUnit, AddJobArgs addJobArgs) {
public Command<K, V, String> addjob(K queue, V job, long commandTimeout, TimeUnit timeUnit, AddJobArgs addJobArgs) {
DisqueCommandArgs<K, V> args = new DisqueCommandArgs<K, V>(codec).addKey(queue).addValue(job);
if (timeUnit != null) {
args.add(timeUnit.toMillis(duration));
args.add(timeUnit.toMillis(commandTimeout));
} else {
args.add(0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ public Observable<Long> ackjob(String... jobIds) {
}

@Override
public Observable<String> addjob(K queue, V job, long duration, TimeUnit timeUnit) {
return createObservable(commandBuilder.addjob(queue, job, duration, timeUnit, null));
public Observable<String> addjob(K queue, V job, long commandTimeout, TimeUnit timeUnit) {
return createObservable(commandBuilder.addjob(queue, job, commandTimeout, timeUnit, null));
}

@Override
public Observable<String> addjob(K queue, V job, long duration, TimeUnit timeUnit, AddJobArgs addJobArgs) {
return createObservable(commandBuilder.addjob(queue, job, duration, timeUnit, addJobArgs));
public Observable<String> addjob(K queue, V job, long commandTimeout, TimeUnit timeUnit, AddJobArgs addJobArgs) {
return createObservable(commandBuilder.addjob(queue, job, commandTimeout, timeUnit, addJobArgs));
}

@Override
Expand Down

0 comments on commit cee5bdb

Please sign in to comment.