Class RedisDB
- java.lang.Object
-
- io.vertigo.stella.plugins.work.redis.RedisDB
-
public final class RedisDB extends Object
- Author:
- pchretien
-
-
Constructor Summary
Constructors Constructor Description RedisDB(CodecManager codecManager, io.vertigo.connectors.redis.RedisConnector redisConnector)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> WorkResult<R>
pollResult(int waitTimeSeconds)
<R,W>
WorkItem<R,W>pollWorkItem(String workType)
Polls a workitem from the todo list.<R> void
putResult(String workId, R result, Throwable error)
Puts the result for a workitem identified by an id.void
putStart(String workId)
<R,W>
voidputWorkItem(WorkItem<R,W> workItem)
Puts a workitem in the todo list.void
reset()
-
-
-
Constructor Detail
-
RedisDB
public RedisDB(CodecManager codecManager, io.vertigo.connectors.redis.RedisConnector redisConnector)
Constructor.- Parameters:
codecManager
- the codecManagerredisConnector
- the redis connector
-
-
Method Detail
-
reset
public void reset()
-
putStart
public void putStart(String workId)
-
putWorkItem
public <R,W> void putWorkItem(WorkItem<R,W> workItem)
Puts a workitem in the todo list.- Parameters:
workItem
- the workItem
-
pollWorkItem
public <R,W> WorkItem<R,W> pollWorkItem(String workType)
Polls a workitem from the todo list.- Parameters:
workType
- the type of workItem- Returns:
- null or a workitem
-
putResult
public <R> void putResult(String workId, R result, Throwable error)
Puts the result for a workitem identified by an id.- Parameters:
workId
- the id of the workitemresult
- the resulterror
- if an error occurred
-
pollResult
public <R> WorkResult<R> pollResult(int waitTimeSeconds)
-
-