title: Asking a grpc StreamObserver if it is still available
body: <p>i have following problem with my code:</p>
  <p>I have a list that contains several objects, these objects should then be transmitted through the stream. However, the stream can have two states, either it has not yet been established or the stream already exists. So far I have solved it as follows:</p>
  <ul>
  <li>created a class variable called &quot;stream&quot; = null</li>
  <li>first, i ask if the variable &quot;stream&quot; is null, if so: Stream get established and saved in the variable &quot;stream&quot;</li>
  <li>And when the last item has been submitted, the streamObserver is calling .onCompleted and the variable &quot;stream&quot; will be null again, because the method with the List can be called again (several times) and i don´t want the stream beeing open the hole time</li>
  </ul>
  <p>Is there a better way to manage these steps? Or are there any problems the way I did it?</p>
  <p>Greetings</p>
  <p>Fabi</p>