Class RedisWorkersPlugin
- java.lang.Object
-
- io.vertigo.stella.plugins.work.redis.workers.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 Summary
Constructors Constructor Description RedisWorkersPlugin(Optional<String> connectorNameOpt, List<io.vertigo.connectors.redis.RedisConnector> redisConnectors, CodecManager codecManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R,W>
WorkItem<R,W>pollWorkItem(String nodeId, String workType)
Polling workitem.<R> void
putResult(String workId, R result, Throwable error)
Send result or error if execution failedvoid
putStart(String workId)
-
-
-
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 interfaceWorkersPlugin
- Type Parameters:
R
- resultW
- workworkType
- 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 interfaceWorkersPlugin
- Type Parameters:
R
- result- Parameters:
workId
- WorkIdresult
- Result (not null if execution succeeded)error
- Error ( not null if execution failed)
-
putStart
public void putStart(String workId)
- Specified by:
putStart
in interfaceWorkersPlugin
-
-