func (c *ProtoCodec) Execute(e Endpoint, ctx Context, msg ...Message) ([]Message, error) {
	if len(msg) == 0 {
		return nil, nil
	}
	var request = &internal.Frame{}
	var response = &internal.Frame{}
	var result = make([]Message, 0, 5)
	var err error
	for _, m := range msg {
		frame, errP := c.packMessage(m)
		if errP != nil {
			return nil, errP
		}
		request.Messages = append(request.Messages, frame)
	}
	p := &payload.Payload{}
	if ctx.IsEmpty() {
		p.Context = []byte("null")
	}
	p.Context, err = jsoniter.Marshal(ctx)
	if err != nil {
		return nil, errors.E(errors.Op("encodeContext"), err)
	}
	p.Body, err = proto.Marshal(v1Proto.MessageV2(request))
	if err != nil {
		return nil, errors.E(errors.Op("encodePayload"), err)
	}
	out, err := e.Exec(p)
	if err != nil {
		return nil, errors.E(errors.Op("execute"), err)
	}
	if len(out.Body) == 0 {
		return nil, nil
	}
	err = proto.Unmarshal(out.Body, v1Proto.MessageV2(response))
	if err != nil {
		return nil, errors.E(errors.Op("parseResponse"), err)
	}
	for _, f := range response.Messages {
		msg, errM := c.parseMessage(f)
		if errM != nil {
			return nil, errM
		}
		result = append(result, msg)
	}
	return result, nil
}
Execute exchanges commands with worker.
package protocol
import (
	v1Proto "github.com/golang/protobuf/proto"  
	jsoniter "github.com/json-iterator/go"
	"github.com/spiral/errors"
	"github.com/spiral/roadrunner-plugins/v2/logger"
	"github.com/spiral/roadrunner/v2/payload"
	"github.com/temporalio/roadrunner-temporal/protocol/internal"
	"google.golang.org/protobuf/proto"
)
type ProtoCodec struct{}
func NewProtoCodec() Codec {
	return &ProtoCodec{}
}
func (c *ProtoCodec) WithLogger(logger logger.Logger) Codec {
	return &ProtoCodec{}
}
func (c *ProtoCodec) GetName() string {
	return "protobuf"
}