def publish_record()

in python-batch/fsi_montecarlo/OLD/pubsub_bq.tpl.py [0:0]


  def publish_record(self,record):

    byte_stream = io.BytesIO()
    encoder = BinaryEncoder(byte_stream)
    self.writer.write(record, encoder)
    data = byte_stream.getvalue()
    byte_stream.flush()
    future = self.publisher_client.publish(self.topic_path, data)
    if(FLAGS.print_raw):
      print(f"Published message ID: {future.result()}")