func WaitForStreamToBeReady(stream grpc.ClientStream) error {
	header, err := stream.Header()
	if err != nil {
		return err
	}
	statuses := header.Get(statusKey)
	statusesLen := len(statuses)
	if statusesLen == 0 {
		return nil  
	}
	lastStatus := statuses[statusesLen-1]
	if lastStatus != statusReady {
		return fmt.Errorf("stream header status is different than ready. Got %q", lastStatus)
	}
	return nil
}
WaitForStreamToBeReady waits until the server publish a header with status ready on the stream.
package acknowledgement
import (
	fmt "fmt"
	grpc "google.golang.org/grpc"
	"google.golang.org/grpc/metadata"
)
const (
	statusKey   = "status"
	statusReady = "ready"
)