如果我将runnable推送到redisson分布式执行器服务,我需要遵守哪些规则?
当然,我不能拥有自由统治,我不明白这是怎么可能的,然而,文档中根本没有提到,也没有任何明显由api强制执行的规则,比如r extends serializable或类似的规则。
如果我通过这个runnable:
new Runnable(()-> {
// What can I access here, and have it be recreated in whatever server instance picks it up later for execution?
// newlyCreatedInstanceCreatedJustBeforeThisRunnableWasCreated.isAccissible(); // ?
// newlyComplexInstanceSuchAsADatabaseDriverThatisAccessedHere.isAccissible(); // ?
// transactionalHibernateEntityContainingStaticReferencesToComplexObjects....
// I think you get the point.
// Does Redisson serialize everything within this scope?
// When it is recreated later, surely, I can not have access to those exact objects, unless they run on the same server, right?
// If the server goes does and up, or another server executes this runnable, then what happens?
// What rules do we have to abide by here?
})
另外,当我们将某个对象推送到rqueue、rblockingdequeu或redisson活动对象时,我们必须遵守哪些规则?
从文件上看不清楚。
另外,如果可以提供一个单一站点文档站点的链接,那就太好了。这里需要大量的点击和导航:
https://github.com/redisson/redisson/wiki/table-of-content
1条答案
按热度按时间cczfrluj1#
https://github.com/redisson/redisson/wiki/9.-distributed-services#933-分布式执行器服务任务
您可以访问redisclient和taskid。任务对象的完整状态将被序列化。
应用于每个任务的taskretry设置。如果任务在开始后的5分钟内没有执行,那么它将重新开始。