Skip to content

Commit

Permalink
fixup! executors: implement streaming exec
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmood Ali committed May 10, 2019
1 parent 90386e4 commit fc4f92b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions drivers/shared/executor/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,22 @@ func (d *grpcExecutorClient) ExecStreaming(ctx context.Context,
tty bool,
execStream drivers.ExecTaskStream) error {

stream, err := d.client.ExecStreaming(ctx)
err := d.execStreaming(ctx, command, tty, execStream)
if err != nil {
return grpcutils.HandleGrpcErr(err, d.doneCtx)
}
return nil
}

func (d *grpcExecutorClient) execStreaming(ctx context.Context,
command []string,
tty bool,
execStream drivers.ExecTaskStream) error {

stream, err := d.client.ExecStreaming(ctx)
if err != nil {
return err
}

err = stream.Send(&dproto.ExecTaskStreamingRequest{
Setup: &dproto.ExecTaskStreamingRequest_Setup{
Expand All @@ -201,7 +213,7 @@ func (d *grpcExecutorClient) ExecStreaming(ctx context.Context,
},
})
if err != nil {
return grpcutils.HandleGrpcErr(err, d.doneCtx)
return err
}

errCh := make(chan error, 1)
Expand Down

0 comments on commit fc4f92b

Please sign in to comment.