@@ -41,7 +41,7 @@ import (
4141
4242// CompilerServerToStreams creates a gRPC CompileServer that sends the responses to the provided streams.
4343// The returned callback function can be used to retrieve the builder result after the compilation is done.
44- func CompilerServerToStreams (ctx context.Context , stdOut , stderr io.Writer ) (server rpc.ArduinoCoreService_CompileServer , resultCB func () * rpc.BuilderResult ) {
44+ func CompilerServerToStreams (ctx context.Context , stdOut , stderr io.Writer , progressCB rpc. TaskProgressCB ) (server rpc.ArduinoCoreService_CompileServer , resultCB func () * rpc.BuilderResult ) {
4545 var builderResult * rpc.BuilderResult
4646 stream := streamResponseToCallback (ctx , func (resp * rpc.CompileResponse ) error {
4747 if out := resp .GetOutStream (); len (out ) > 0 {
@@ -57,6 +57,11 @@ func CompilerServerToStreams(ctx context.Context, stdOut, stderr io.Writer) (ser
5757 if result := resp .GetResult (); result != nil {
5858 builderResult = result
5959 }
60+ if progress := resp .GetProgress (); progress != nil {
61+ if progressCB != nil {
62+ progressCB (progress )
63+ }
64+ }
6065 return nil
6166 })
6267 return stream , func () * rpc.BuilderResult { return builderResult }
0 commit comments