AsynchronousChannelGroup.WithFixedThreadPool(Int32, IThreadFactory) Method

Definition

Creates an asynchronous channel group with a fixed thread pool.

[Android.Runtime.Register("withFixedThreadPool", "(ILjava/util/concurrent/ThreadFactory;)Ljava/nio/channels/AsynchronousChannelGroup;", "", ApiSince=26)]
public static Java.Nio.Channels.AsynchronousChannelGroup? WithFixedThreadPool (int nThreads, Java.Util.Concurrent.IThreadFactory? threadFactory);
[<Android.Runtime.Register("withFixedThreadPool", "(ILjava/util/concurrent/ThreadFactory;)Ljava/nio/channels/AsynchronousChannelGroup;", "", ApiSince=26)>]
static member WithFixedThreadPool : int * Java.Util.Concurrent.IThreadFactory -> Java.Nio.Channels.AsynchronousChannelGroup

Parameters

nThreads
Int32

The number of threads in the pool

threadFactory
IThreadFactory

The factory to use when creating new threads

Returns

A new asynchronous channel group

Attributes

Remarks

Creates an asynchronous channel group with a fixed thread pool.

The resulting asynchronous channel group reuses a fixed number of threads. At any point, at most nThreads threads will be active processing tasks that are submitted to handle I/O events and dispatch completion results for operations initiated on asynchronous channels in the group.

The group is created by invoking the AsynchronousChannelProvider#openAsynchronousChannelGroup(int,ThreadFactory) openAsynchronousChannelGroup(int,ThreadFactory) method of the system-wide default AsynchronousChannelProvider object.

Java documentation for java.nio.channels.AsynchronousChannelGroup.withFixedThreadPool(int, 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