Udostępnij za pośrednictwem


Executors.NewSingleThreadScheduledExecutor Method

Definition

Overloads

NewSingleThreadScheduledExecutor()

Creates a single-threaded executor that can schedule commands to run after a given delay, or to execute periodically.

NewSingleThreadScheduledExecutor(IThreadFactory)

Creates a single-threaded executor that can schedule commands to run after a given delay, or to execute periodically.

NewSingleThreadScheduledExecutor()

Creates a single-threaded executor that can schedule commands to run after a given delay, or to execute periodically.

[Android.Runtime.Register("newSingleThreadScheduledExecutor", "()Ljava/util/concurrent/ScheduledExecutorService;", "")]
public static Java.Util.Concurrent.IScheduledExecutorService? NewSingleThreadScheduledExecutor ();
[<Android.Runtime.Register("newSingleThreadScheduledExecutor", "()Ljava/util/concurrent/ScheduledExecutorService;", "")>]
static member NewSingleThreadScheduledExecutor : unit -> Java.Util.Concurrent.IScheduledExecutorService

Returns

the newly created scheduled executor

Attributes

Remarks

Creates a single-threaded executor that can schedule commands to run after a given delay, or to execute periodically. (Note however that if this single thread terminates due to a failure during execution prior to shutdown, a new one will take its place if needed to execute subsequent tasks.) Tasks are guaranteed to execute sequentially, and no more than one task will be active at any given time. Unlike the otherwise equivalent newScheduledThreadPool(1) the returned executor is guaranteed not to be reconfigurable to use additional threads.

Java documentation for java.util.concurrent.Executors.newSingleThreadScheduledExecutor().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

NewSingleThreadScheduledExecutor(IThreadFactory)

Creates a single-threaded executor that can schedule commands to run after a given delay, or to execute periodically.

[Android.Runtime.Register("newSingleThreadScheduledExecutor", "(Ljava/util/concurrent/ThreadFactory;)Ljava/util/concurrent/ScheduledExecutorService;", "")]
public static Java.Util.Concurrent.IScheduledExecutorService? NewSingleThreadScheduledExecutor (Java.Util.Concurrent.IThreadFactory? threadFactory);
[<Android.Runtime.Register("newSingleThreadScheduledExecutor", "(Ljava/util/concurrent/ThreadFactory;)Ljava/util/concurrent/ScheduledExecutorService;", "")>]
static member NewSingleThreadScheduledExecutor : Java.Util.Concurrent.IThreadFactory -> Java.Util.Concurrent.IScheduledExecutorService

Parameters

threadFactory
IThreadFactory

the factory to use when creating new threads

Returns

the newly created scheduled executor

Attributes

Exceptions

if threadFactory is null

Remarks

Creates a single-threaded executor that can schedule commands to run after a given delay, or to execute periodically. (Note however that if this single thread terminates due to a failure during execution prior to shutdown, a new one will take its place if needed to execute subsequent tasks.) Tasks are guaranteed to execute sequentially, and no more than one task will be active at any given time. Unlike the otherwise equivalent newScheduledThreadPool(1, threadFactory) the returned executor is guaranteed not to be reconfigurable to use additional threads.

Java documentation for java.util.concurrent.Executors.newSingleThreadScheduledExecutor(java.util.concurrent.ThreadFactory).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to