Class Sync<T>

java.lang.Object
swim.concurrent.Sync<T>
All Implemented Interfaces:
ForkJoinPool.ManagedBlocker, Cont<T>

public class Sync<T> extends Object implements Cont<T>, ForkJoinPool.ManagedBlocker
A Continuation whose completion can be synchronously awaited. A Sync continuation is used to await the completion of an asynchronous operation.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new Sync continuation that awaits a value of type T.
  • Method Summary

    Modifier and Type
    Method
    Description
    Waits an unbounded amount of time for this Sync continuation to complete.
    await(long timeout)
    Waits a maximum of timeout milliseconds for this Sync continuation to complete.
    void
    bind(T value)
    Invoked when the asynchronous operation completes with a value.
    boolean
     
    boolean
     
    void
    trap(Throwable error)
    Invoked when the asynchronous operation fails with an error.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Sync

      public Sync()
      Constructs a new Sync continuation that awaits a value of type T.
  • Method Details