Interface Subscription

All Superinterfaces:
Cancelable

public interface Subscription extends Cancelable
The Subscription is the link to 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.2
Author:
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.redis.stream.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.