Class RedisDB


  • public final class RedisDB
    extends Object
    Author:
    pchretien
    • Constructor Detail

      • RedisDB

        public RedisDB​(CodecManager codecManager,
                       io.vertigo.connectors.redis.RedisConnector redisConnector)
        Constructor.
        Parameters:
        codecManager - the codecManager
        redisConnector - 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 workitem
        result - the result
        error - if an error occurred
      • pollResult

        public <R> WorkResult<R> pollResult​(int waitTimeSeconds)