# Class EventStream

java.lang.Object
com.google.adk.events.EventStream

All Implemented Interfaces:
  `Iterable<Event>`

public class EventStream extends Object implements Iterable<Event>
Iterable stream of `Event` objects.

NOTE: This class is not thread-safe. Concurrent iteration from multiple threads should be avoided or externally synchronized.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `EventStream(Supplier<Event> eventSupplier)`
  Constructs a new event stream.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Iterator<Event>`
  `iterator()`
  Returns an iterator that fetches events lazily.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface Iterable

  `forEach, spliterator`

- ## Constructor Details

  - ### EventStream

    public EventStream(Supplier<Event> eventSupplier)
    Constructs a new event stream.

- ## Method Details

  - ### iterator

    public Iterator<Event> iterator()
    Returns an iterator that fetches events lazily.
    Specified by:
      `iterator` in interface `Iterable<Event>`