From cee5bdb871264d4d72dcf85d5b8c9f21e1cf9e2b Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Mon, 4 Jan 2016 18:38:45 +0100 Subject: [PATCH] Fix addjob documentation about timeout/TTL #21 --- .../spinach/api/async/DisqueJobAsyncCommands.java | 12 ++++++------ .../spinach/api/rx/DisqueJobReactiveCommands.java | 12 ++++++------ .../paluch/spinach/api/sync/DisqueJobCommands.java | 12 ++++++------ .../paluch/spinach/impl/DisqueAsyncCommandsImpl.java | 8 ++++---- .../paluch/spinach/impl/DisqueCommandBuilder.java | 4 ++-- .../spinach/impl/DisqueReactiveCommandsImpl.java | 8 ++++---- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/main/java/biz/paluch/spinach/api/async/DisqueJobAsyncCommands.java b/src/main/java/biz/paluch/spinach/api/async/DisqueJobAsyncCommands.java index 288b498..4aacb10 100644 --- a/src/main/java/biz/paluch/spinach/api/async/DisqueJobAsyncCommands.java +++ b/src/main/java/biz/paluch/spinach/api/async/DisqueJobAsyncCommands.java @@ -34,11 +34,11 @@ public interface DisqueJobAsyncCommands { * * @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 addjob(K queue, V job, long timeout, TimeUnit timeUnit); + RedisFuture addjob(K queue, V job, long commandTimeout, TimeUnit timeUnit); /** * @@ -46,12 +46,12 @@ public interface DisqueJobAsyncCommands { * * @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 addjob(K queue, V job, long timeout, TimeUnit timeUnit, AddJobArgs addJobArgs); + RedisFuture 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 diff --git a/src/main/java/biz/paluch/spinach/api/rx/DisqueJobReactiveCommands.java b/src/main/java/biz/paluch/spinach/api/rx/DisqueJobReactiveCommands.java index 98d496b..8c5d33c 100644 --- a/src/main/java/biz/paluch/spinach/api/rx/DisqueJobReactiveCommands.java +++ b/src/main/java/biz/paluch/spinach/api/rx/DisqueJobReactiveCommands.java @@ -34,11 +34,11 @@ public interface DisqueJobReactiveCommands { * * @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 addjob(K queue, V job, long timeout, TimeUnit timeUnit); + Observable addjob(K queue, V job, long commandTimeout, TimeUnit timeUnit); /** * @@ -46,12 +46,12 @@ public interface DisqueJobReactiveCommands { * * @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 addjob(K queue, V job, long timeout, TimeUnit timeUnit, AddJobArgs addJobArgs); + Observable 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 diff --git a/src/main/java/biz/paluch/spinach/api/sync/DisqueJobCommands.java b/src/main/java/biz/paluch/spinach/api/sync/DisqueJobCommands.java index 9e0a580..afa6b0c 100644 --- a/src/main/java/biz/paluch/spinach/api/sync/DisqueJobCommands.java +++ b/src/main/java/biz/paluch/spinach/api/sync/DisqueJobCommands.java @@ -34,11 +34,11 @@ public interface DisqueJobCommands { * * @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); /** * @@ -46,12 +46,12 @@ public interface DisqueJobCommands { * * @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 diff --git a/src/main/java/biz/paluch/spinach/impl/DisqueAsyncCommandsImpl.java b/src/main/java/biz/paluch/spinach/impl/DisqueAsyncCommandsImpl.java index 320c7d3..ab2a808 100644 --- a/src/main/java/biz/paluch/spinach/impl/DisqueAsyncCommandsImpl.java +++ b/src/main/java/biz/paluch/spinach/impl/DisqueAsyncCommandsImpl.java @@ -46,13 +46,13 @@ public RedisFuture ackjob(String... jobIds) { } @Override - public RedisFuture addjob(K queue, V job, long duration, TimeUnit timeUnit) { - return dispatch(commandBuilder.addjob(queue, job, duration, timeUnit, null)); + public RedisFuture addjob(K queue, V job, long commandTimeout, TimeUnit timeUnit) { + return dispatch(commandBuilder.addjob(queue, job, commandTimeout, timeUnit, null)); } @Override - public RedisFuture addjob(K queue, V job, long duration, TimeUnit timeUnit, AddJobArgs addJobArgs) { - return dispatch(commandBuilder.addjob(queue, job, duration, timeUnit, addJobArgs)); + public RedisFuture addjob(K queue, V job, long commandTimeout, TimeUnit timeUnit, AddJobArgs addJobArgs) { + return dispatch(commandBuilder.addjob(queue, job, commandTimeout, timeUnit, addJobArgs)); } @Override diff --git a/src/main/java/biz/paluch/spinach/impl/DisqueCommandBuilder.java b/src/main/java/biz/paluch/spinach/impl/DisqueCommandBuilder.java index 1f9fa17..530a137 100644 --- a/src/main/java/biz/paluch/spinach/impl/DisqueCommandBuilder.java +++ b/src/main/java/biz/paluch/spinach/impl/DisqueCommandBuilder.java @@ -38,10 +38,10 @@ public Command ackjob(String[] jobIds) { return createCommand(ACKJOB, new IntegerOutput(codec), args); } - public Command addjob(K queue, V job, long duration, TimeUnit timeUnit, AddJobArgs addJobArgs) { + public Command addjob(K queue, V job, long commandTimeout, TimeUnit timeUnit, AddJobArgs addJobArgs) { DisqueCommandArgs args = new DisqueCommandArgs(codec).addKey(queue).addValue(job); if (timeUnit != null) { - args.add(timeUnit.toMillis(duration)); + args.add(timeUnit.toMillis(commandTimeout)); } else { args.add(0); } diff --git a/src/main/java/biz/paluch/spinach/impl/DisqueReactiveCommandsImpl.java b/src/main/java/biz/paluch/spinach/impl/DisqueReactiveCommandsImpl.java index 7445a37..b30c5f1 100644 --- a/src/main/java/biz/paluch/spinach/impl/DisqueReactiveCommandsImpl.java +++ b/src/main/java/biz/paluch/spinach/impl/DisqueReactiveCommandsImpl.java @@ -49,13 +49,13 @@ public Observable ackjob(String... jobIds) { } @Override - public Observable addjob(K queue, V job, long duration, TimeUnit timeUnit) { - return createObservable(commandBuilder.addjob(queue, job, duration, timeUnit, null)); + public Observable addjob(K queue, V job, long commandTimeout, TimeUnit timeUnit) { + return createObservable(commandBuilder.addjob(queue, job, commandTimeout, timeUnit, null)); } @Override - public Observable addjob(K queue, V job, long duration, TimeUnit timeUnit, AddJobArgs addJobArgs) { - return createObservable(commandBuilder.addjob(queue, job, duration, timeUnit, addJobArgs)); + public Observable addjob(K queue, V job, long commandTimeout, TimeUnit timeUnit, AddJobArgs addJobArgs) { + return createObservable(commandBuilder.addjob(queue, job, commandTimeout, timeUnit, addJobArgs)); } @Override