title: Is it OK to use gRPC to push data?
body: <p>I'm wondering if it's a good idea to push data from gRPC server to a client. Basically I want to use a pub/sub pattern with gRPC. 
  The way I do is that I return a response stream on the server implementation that I never close. Then, the client has a never ending go routine in charge of reading this stream.</p>
  
  <p>Here is an example:</p>
  
  <pre><code>service Service {
      rpc RegularChanges (Void) returns (stream Change) {}
  }
  </code></pre>
  
  <p>On the server side:</p>
  
  <pre><code>func (self *MyServiceImpl) RegularChanges(in *pb.Void, stream pb.Service_RegularChangesServer) error {
  
      for {
          d, err := time.ParseDuration("1s")
          if err != nil {
              log.Fatalf("Cannot parse duration")
              break;
          }
          time.Sleep(d)
          stream.Send(&amp;pb.Change{Name:"toto", Description:"status changed"})
      }
      return nil
  }
  </code></pre>
  
  <p>On client:</p>
  
  <pre><code>for {
          change, err := streamChanges.Recv()
          if err != nil {
              log.Fatalf("Error retrieving change")
          } else {
              log.Println(change)
          }
  }
  </code></pre>
  
  <p>I just began with go and gRPC but I know it's based on HTTP2, hence it should support pushing datas. However, I'm not sure this is the way gRPC should be used.</p>