共用方式為


ICompletionService Interface

Definition

A service that decouples the production of new asynchronous tasks from the consumption of the results of completed tasks.

[Android.Runtime.Register("java/util/concurrent/CompletionService", "", "Java.Util.Concurrent.ICompletionServiceInvoker")]
[Java.Interop.JavaTypeParameters(new System.String[] { "V" })]
public interface ICompletionService : Android.Runtime.IJavaObject, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("java/util/concurrent/CompletionService", "", "Java.Util.Concurrent.ICompletionServiceInvoker")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "V" })>]
type ICompletionService = interface
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Derived
Attributes
Implements

Remarks

A service that decouples the production of new asynchronous tasks from the consumption of the results of completed tasks. Producers submit tasks for execution. Consumers take completed tasks and process their results in the order they complete. A CompletionService can for example be used to manage asynchronous I/O, in which tasks that perform reads are submitted in one part of a program or system, and then acted upon in a different part of the program when the reads complete, possibly in a different order than they were requested.

Typically, a CompletionService relies on a separate Executor to actually execute the tasks, in which case the CompletionService only manages an internal completion queue. The ExecutorCompletionService class provides an implementation of this approach.

Memory consistency effects: Actions in a thread prior to submitting a task to a CompletionService<i>happen-before</i> actions taken by that task, which in turn happen-before actions following a successful return from the corresponding take().

Added in 1.5.

Java documentation for java.util.concurrent.CompletionService.

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.

Properties

Handle

Gets the JNI value of the underlying Android object.

(Inherited from IJavaObject)
JniIdentityHashCode

Returns the value of java.lang.System.identityHashCode() for the wrapped instance.

(Inherited from IJavaPeerable)
JniManagedPeerState

State of the managed peer.

(Inherited from IJavaPeerable)
JniPeerMembers

Member access and invocation support.

(Inherited from IJavaPeerable)
PeerReference

Returns a JniObjectReference of the wrapped Java object instance.

(Inherited from IJavaPeerable)

Methods

Disposed()

Called when the instance has been disposed.

(Inherited from IJavaPeerable)
DisposeUnlessReferenced()

If there are no outstanding references to this instance, then calls Dispose(); otherwise, does nothing.

(Inherited from IJavaPeerable)
Finalized()

Called when the instance has been finalized.

(Inherited from IJavaPeerable)
Poll()

Retrieves and removes the Future representing the next completed task, or null if none are present.

Poll(Int64, TimeUnit)

Retrieves and removes the Future representing the next completed task, waiting if necessary up to the specified wait time if none are yet present.

SetJniIdentityHashCode(Int32)

Set the value returned by JniIdentityHashCode.

(Inherited from IJavaPeerable)
SetJniManagedPeerState(JniManagedPeerStates) (Inherited from IJavaPeerable)
SetPeerReference(JniObjectReference)

Set the value returned by PeerReference.

(Inherited from IJavaPeerable)
Submit(ICallable)

Submits a value-returning task for execution and returns a Future representing the pending results of the task.

Submit(IRunnable, Object)

Submits a Runnable task for execution and returns a Future representing that task.

Take()

Retrieves and removes the Future representing the next completed task, waiting if none are yet present.

UnregisterFromRuntime()

Unregister this instance so that the runtime will not return it from future Java.Interop.JniRuntime+JniValueManager.PeekValue invocations.

(Inherited from IJavaPeerable)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to