Exemplo n.º 1
0
// StreamUpdate is part of the pbs.UpdateStreamServer interface
func (server *UpdateStream) StreamUpdate(req *pb.StreamUpdateRequest, stream pbs.UpdateStream_StreamUpdateServer) (err error) {
	defer server.updateStream.HandlePanic(&err)
	return server.updateStream.ServeUpdateStream(req.Position, func(reply *pb.StreamEvent) error {
		return stream.Send(&pb.StreamUpdateResponse{
			StreamEvent: reply,
		})
	})
}
Exemplo n.º 2
0
// StreamUpdate is part of the pbs.UpdateStreamServer interface
func (server *UpdateStream) StreamUpdate(req *pb.StreamUpdateRequest, stream pbs.UpdateStream_StreamUpdateServer) (err error) {
	defer server.updateStream.HandlePanic(&err)
	return server.updateStream.ServeUpdateStream(&proto.UpdateStreamRequest{
		Position: myproto.ProtoToReplicationPosition(req.Position),
	}, func(reply *proto.StreamEvent) error {
		return stream.Send(&pb.StreamUpdateResponse{
			StreamEvent: proto.StreamEventToProto(reply),
		})
	})
}
Exemplo n.º 3
0
// StreamUpdate is part of the pbs.UpdateStreamServer interface
func (server *UpdateStream) StreamUpdate(req *pb.StreamUpdateRequest, stream pbs.UpdateStream_StreamUpdateServer) (err error) {
	defer server.updateStream.HandlePanic(&err)
	return server.updateStream.ServeUpdateStream(req.Position, func(reply *proto.StreamEvent) error {
		event, err := proto.StreamEventToProto(reply)
		if err != nil {
			return err
		}
		return stream.Send(&pb.StreamUpdateResponse{
			StreamEvent: event,
		})
	})
}