Interface Subscription

All Superinterfaces:
AutoCloseable

public interface Subscription extends AutoCloseable
A leased event subscription created by Space.notify(Template, SpaceListener, Lease). Like all shared state, a subscription vanishes unless renewed; close it to stop delivery immediately.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Cancels the subscription.
    void
    renew(Duration extension)
    Extends the subscription lease by the given duration from now.
  • Method Details

    • renew

      void renew(Duration extension)
      Extends the subscription lease by the given duration from now.
      Parameters:
      extension - how much longer the subscription should live
      Throws:
      LeaseExpiredException - if the lease already lapsed
    • close

      void close()
      Cancels the subscription. Idempotent.
      Specified by:
      close in interface AutoCloseable