Interface ResponseStream.ResourceConsumer<T extends @NonNull AutoCloseable>

Type Parameters:
T - the resource type
Enclosing interface:
ResponseStream
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

A lexical resource body invoked on the response producer thread. Implementations reused across responses must support concurrent invocation of their shared state; each response still confines its resource consumption to its own producer thread.
Author:
Mark Allen
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    accept(@NonNull T resource)
    Uses the resource within its lexical lifetime.
  • Method Details

    • accept

      void accept(@NonNull T resource) throws Exception
      Uses the resource within its lexical lifetime.
      Parameters:
      resource - the owned resource
      Throws:
      Exception - if the lexical body fails