Class NeedleEye

java.lang.Object
org.opencastproject.util.NeedleEye

public final class NeedleEye extends Object
Only one function application can be threaded through the needle eye at a time.
  • Constructor Details

    • NeedleEye

      public NeedleEye()
  • Method Details

    • apply

      public <A> Option<A> apply(Function0<A> f)
      Apply function f only if no other thread currently applies a function using this needle eye. Please note that f must not return null, so please do not use Effect0.
      Returns:
      the result of f or none if another function is currently being applied.