Interface Subscription

All Superinterfaces:
Cancelable

public interface Subscription extends Cancelable
The Subscription is the link between the SubscriptionRequest and the actual running Task.
Due to the asynchronous nature of the Task execution a Subscription might not immediately become active. isActive() provides an answer if the underlying Task is already running.
Since:
2.1
Author:
Christoph Strobl, Mark Paluch
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    await(Duration timeout)
    Synchronous, blocking call returns once the Subscription becomes active or timeout exceeds.
    boolean
     

    Methods inherited from interface org.springframework.data.mongodb.core.messaging.Cancelable

    cancel
  • Method Details

    • isActive

      boolean isActive()
      Returns:
      true if the subscription is currently executed.
    • await

      boolean await(Duration timeout) throws InterruptedException
      Synchronous, blocking call returns once the Subscription becomes active or timeout exceeds.
      Parameters:
      timeout - must not be null.
      Returns:
      true if the subscription was activated. false if the waiting time elapsed before task was activated.
      Throws:
      InterruptedException - if the current thread is interrupted while waiting.