ScheduledThreadPoolExecutor.Schedule 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| Schedule(IRunnable, Int64, TimeUnit) |
创建并执行在给定延迟后启用的一次性操作。 |
| Schedule(ICallable, Int64, TimeUnit) |
提交一个值返回的一次性任务,该任务在给定延迟后启用。 |
Schedule(IRunnable, Int64, TimeUnit)
创建并执行在给定延迟后启用的一次性操作。
[Android.Runtime.Register("schedule", "(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;", "GetSchedule_Ljava_lang_Runnable_JLjava_util_concurrent_TimeUnit_Handler")]
public virtual Java.Util.Concurrent.IScheduledFuture? Schedule(Java.Lang.IRunnable? command, long delay, Java.Util.Concurrent.TimeUnit? unit);
[<Android.Runtime.Register("schedule", "(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;", "GetSchedule_Ljava_lang_Runnable_JLjava_util_concurrent_TimeUnit_Handler")>]
abstract member Schedule : Java.Lang.IRunnable * int64 * Java.Util.Concurrent.TimeUnit -> Java.Util.Concurrent.IScheduledFuture
override this.Schedule : Java.Lang.IRunnable * int64 * Java.Util.Concurrent.TimeUnit -> Java.Util.Concurrent.IScheduledFuture
参数
- command
- IRunnable
要执行的任务
- delay
- Int64
从现在到延迟执行的时间
- unit
- TimeUnit
延迟参数的时间单位
返回
一个 ScheduledFuture,表示任务待完成,其 get() 方法在完成时将返回 null
实现
- 属性
例外
注解
提交在给定延迟后启用的一次性任务。
Java参考java.util.concurrent.ScheduledThreadPoolExecutor.schedule。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
适用于
Schedule(ICallable, Int64, TimeUnit)
提交一个值返回的一次性任务,该任务在给定延迟后启用。
[Android.Runtime.Register("schedule", "(Ljava/util/concurrent/Callable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;", "GetSchedule_Ljava_util_concurrent_Callable_JLjava_util_concurrent_TimeUnit_Handler")]
[Java.Interop.JavaTypeParameters(new System.String[] { "V" })]
public virtual Java.Util.Concurrent.IScheduledFuture? Schedule(Java.Util.Concurrent.ICallable? callable, long delay, Java.Util.Concurrent.TimeUnit? unit);
[<Android.Runtime.Register("schedule", "(Ljava/util/concurrent/Callable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;", "GetSchedule_Ljava_util_concurrent_Callable_JLjava_util_concurrent_TimeUnit_Handler")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "V" })>]
abstract member Schedule : Java.Util.Concurrent.ICallable * int64 * Java.Util.Concurrent.TimeUnit -> Java.Util.Concurrent.IScheduledFuture
override this.Schedule : Java.Util.Concurrent.ICallable * int64 * Java.Util.Concurrent.TimeUnit -> Java.Util.Concurrent.IScheduledFuture
参数
- callable
- ICallable
要执行的函数
- delay
- Int64
从现在到延迟执行的时间
- unit
- TimeUnit
延迟参数的时间单位
返回
可用于提取结果或取消的 ScheduledFuture
实现
- 属性
注解
提交一个值返回的一次性任务,该任务在给定延迟后启用。
Java参考java.util.concurrent.ScheduledThreadPoolExecutor.schedule。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。