func (w *Worker) EnqueueRPCWithOptions(
	routeStr string,
	metadata map[string]interface{},
	reply, arg proto.Message,
	opts *config.EnqueueOpts,
) (jid string, err error) {
	return workers.EnqueueWithOptions(rpcQueue, class, &rpcInfo{
		Route:    routeStr,
		Metadata: metadata,
		Arg:      arg,
		Reply:    reply,
	}, w.enqueueOptions(opts))
}
EnqueueRPCWithOptions enqueues rpc job to worker
package worker
import (
	"context"
	"encoding/json"
	"os"
	"github.com/golang/protobuf/proto"
	workers "github.com/topfreegames/go-workers"
	"github.com/topfreegames/pitaya/v2/config"
	"github.com/topfreegames/pitaya/v2/constants"
	"github.com/topfreegames/pitaya/v2/logger"
	"github.com/topfreegames/pitaya/v2/logger/interfaces"
)
type Worker struct {
	concurrency int
	registered  bool
	opts        *config.EnqueueOpts
	started     bool
}
func NewWorker(config config.WorkerConfig, opts config.EnqueueOpts) (*Worker, error) {
	hostname, err := os.Hostname()
	if err != nil {
		return nil, err
	}
	workers.Configure(map[string]string{
		"server":    config.Redis.ServerURL,
		"pool":      config.Redis.Pool,
		"password":  config.Redis.Password,
		"namespace": config.Namespace,
		"process":   hostname,
	})
	return &Worker{
		concurrency: config.Concurrency,
		opts:        &opts,
	}, nil
}
func (w *Worker) SetLogger(logger interfaces.Logger) {
	workers.Logger = logger
}
func (w *Worker) Start() {
	go workers.Start()
	w.started = true
}
func (w *Worker) Started() bool {
	return w != nil && w.started
}
func (w *Worker) EnqueueRPC(
	routeStr string,
	metadata map[string]interface{},
	reply, arg proto.Message,
) (jid string, err error) {
	opts := w.enqueueOptions(w.opts)
	return workers.EnqueueWithOptions(rpcQueue, class, &rpcInfo{
		Route:    routeStr,
		Metadata: metadata,
		Arg:      arg,
		Reply:    reply,
	}, opts)
}