草庐IT

scheduled

全部标签

c# - 使用 SubscribeOn(Scheduler.TaskPool) 时避免在 Rx 中重叠 OnNext 调用

我有一些使用Rx的代码,从多个线程调用:subject.OnNext(value);//wheresubjectisSubject我希望在后台处理这些值,所以我的订阅是subscription=subject.ObserveOn(Scheduler.TaskPool).Subscribe(value=>{//usevalue});我真的不关心哪些线程处理来自Observable的值,只要工作被放入TaskPool并且不阻塞当前线程即可。但是,我在OnNext委托(delegate)中使用的“值”不是线程安全的。目前,如果有很多值通过Observable,我会收到对OnNext处理程序的

spring - Java 示例 : Dynamic Job Scheduling with Quartz

我想公开一个用户界面来动态定义QuartzJOB。用户应该能够定义JOB属性,如JOB名称、cron表达式或时间间隔、任务的特定java类等。是否有任何开源可以促进此功能?或者,如果我想为动态QuartzScheduler创建自己的模块,应该怎么做? 最佳答案 DynamicQuartzJOBScheduling的示例代码:Maven依赖项org.quartz-schedulerquartz1.8.5org.springframeworkspring-core${spring.version}org.springframeworks

spring - Java 示例 : Dynamic Job Scheduling with Quartz

我想公开一个用户界面来动态定义QuartzJOB。用户应该能够定义JOB属性,如JOB名称、cron表达式或时间间隔、任务的特定java类等。是否有任何开源可以促进此功能?或者,如果我想为动态QuartzScheduler创建自己的模块,应该怎么做? 最佳答案 DynamicQuartzJOBScheduling的示例代码:Maven依赖项org.quartz-schedulerquartz1.8.5org.springframeworkspring-core${spring.version}org.springframeworks

Spring的@Scheduled错误: Only one AsyncAnnotationBeanPostProcessor may exist within the context

我正在尝试Spring3的@Scheduled注释。这是我的配置(app.xml)://otherbeans这是我的服务类:@ServicepublicclassServiceImplimplementsService,Serializable{//otherinjections@Override@TransactionalpublicvoidtimeConsumingJob(){try{Thread.sleep(10*1000);}catch(InterruptedExceptione){e.printStackTrace();}}@Override@Scheduled(cron="

Spring的@Scheduled错误: Only one AsyncAnnotationBeanPostProcessor may exist within the context

我正在尝试Spring3的@Scheduled注释。这是我的配置(app.xml)://otherbeans这是我的服务类:@ServicepublicclassServiceImplimplementsService,Serializable{//otherinjections@Override@TransactionalpublicvoidtimeConsumingJob(){try{Thread.sleep(10*1000);}catch(InterruptedExceptione){e.printStackTrace();}}@Override@Scheduled(cron="

java - 如何在运行时更改 Spring 的 @Scheduled fixedDelay?

我需要以固定的时间间隔运行批处理作业,并且能够在运行时更改此批处理作业的时间。为此,我遇到了Spring框架下提供的@Scheduled注释。但我不确定如何在运行时更改fixedDelay的值。我做了一些谷歌搜索,但没有发现任何有用的东西。 最佳答案 在springboot中,可以直接使用一个应用属性!例如:@Scheduled(fixedDelayString="${my.property.fixed.delay.seconds}000")privatevoidprocess(){//yourimplhere}请注意,如果未定义属

java - 如何在运行时更改 Spring 的 @Scheduled fixedDelay?

我需要以固定的时间间隔运行批处理作业,并且能够在运行时更改此批处理作业的时间。为此,我遇到了Spring框架下提供的@Scheduled注释。但我不确定如何在运行时更改fixedDelay的值。我做了一些谷歌搜索,但没有发现任何有用的东西。 最佳答案 在springboot中,可以直接使用一个应用属性!例如:@Scheduled(fixedDelayString="${my.property.fixed.delay.seconds}000")privatevoidprocess(){//yourimplhere}请注意,如果未定义属

java - 从 Spring 3 迁移到 Spring 4 - org.springframework.scheduling.quartz.CronTriggerBean

我正在尝试从spring3.0.5迁移到spring4.1.X。Spring3有一个名为“org.springframework.scheduling.quartz.CronTriggerBean”的类但是Spring4不包含这个类名。[5/28/1520:10:16:798EDT]00000092ClassPathXmlAWorg.springframework.context.support.AbstractApplicationContext__refreshExceptionencounteredduringcontextinitialization-cancellingref

java - 从 Spring 3 迁移到 Spring 4 - org.springframework.scheduling.quartz.CronTriggerBean

我正在尝试从spring3.0.5迁移到spring4.1.X。Spring3有一个名为“org.springframework.scheduling.quartz.CronTriggerBean”的类但是Spring4不包含这个类名。[5/28/1520:10:16:798EDT]00000092ClassPathXmlAWorg.springframework.context.support.AbstractApplicationContext__refreshExceptionencounteredduringcontextinitialization-cancellingref

java - 如何停止使用@Scheduled 注解启动的计划任务?

我使用SpringFramework的@Scheduled创建了一个简单的计划任务。注释。@Scheduled(fixedRate=2000)publicvoiddoSomething(){}现在我想在不再需要时停止此任务。我知道有一种替代方法可以在此方法开始时检查一个条件标志,但这不会停止此方法的执行。Spring是否提供了任何东西来停止@Scheduled任务? 最佳答案 选项1:使用后处理器供应ScheduledAnnotationBeanPostProcessor并显式调用postProcessBeforeDestructi