我正在使用ScheduledExecutorService执行一个以固定速率调用服务的任务。服务可能会向任务返回一些数据。该任务将数据存储在队列中。java.util.concurrent.BlockingQueue;import java.util.concurrent.ScheduledExecutorServiceimport java.util.concurrent.TimeUnit;
public class EverlastingThread i
我还必须根据连接情况暂停和恢复连接(如果手机离线,甚至不需要尝试)。我目前的解决方案是有效的,但它使用标准Java的ScheduledExecutorService来执行周期性任务,但我希望继续使用Rx范式。 final ScheduledExecutorServicescheduledExecutorService = Executors.newSingleThreadSchedul
我尝试的解决方案是从Kafka获取事件并检查队列中第一个事件的时间戳,如果该事件已经是45分钟,那么处理它,或者如果它少于45分钟,那么使用方法暂停轮询kafka容器的时间,直到它达到45分钟为止。// pause container, and later resume it ScheduledExecutorServicescheduledExecutorService = Executors.new