Class RedisWorkersPlugin

  • All Implemented Interfaces:
    io.vertigo.core.node.component.CoreComponent, io.vertigo.core.node.component.Plugin, WorkersPlugin

    public final class RedisWorkersPlugin
    extends Object
    implements WorkersPlugin
    NodePlugin Ce plugin permet d'exécuter des travaux en mode distribué. REDIS est utilisé comme plateforme d'échanges.
    Author:
    pchretien
    • Constructor Detail

      • RedisWorkersPlugin

        @Inject
        public RedisWorkersPlugin​(Optional<String> connectorNameOpt,
                                  List<io.vertigo.connectors.redis.RedisConnector> redisConnectors,
                                  CodecManager codecManager)
        Parameters:
        codecManager -
        redisConnector -
    • Method Detail

      • pollWorkItem

        public <R,​W> WorkItem<R,​W> pollWorkItem​(String nodeId,
                                                            String workType)
        Polling workitem.
        Specified by:
        pollWorkItem in interface WorkersPlugin
        Type Parameters:
        R - result
        W - work
        workType - Type de tache
        Returns:
        Workitem or null (if timeout)
      • putResult

        public <R> void putResult​(String workId,
                                  R result,
                                  Throwable error)
        Send result or error if execution failed
        Specified by:
        putResult in interface WorkersPlugin
        Type Parameters:
        R - result
        Parameters:
        workId - WorkId
        result - Result (not null if execution succeeded)
        error - Error ( not null if execution failed)