Skip to content
Node: bullgithub.com/sahilkhaire/gox/queue

ServeMux.NewServeMux

Overview

NewServeMux returns an empty task router.

Part of the queue package — Node.js analog: bull.

Method on ServeMux — call it on a value of that type after constructing or receiving one from a constructor.

Signature

go
func NewServeMux() *ServeMux

Compare: Node.js · Standard Go · gox

js
// Typical bull pattern in Node.js
go
// hibiken/asynq client + worker
go
import "github.com/sahilkhaire/gox/queue"

mux := queue.NewServeMux()

Example

go
import "github.com/sahilkhaire/gox/queue"

mux := queue.NewServeMux()

Tips

Obtain a ServeMux value first (see constructors on the package overview), then call NewServeMux.

Standard library alternative

gox wraps the Go standard library or a trusted dependency with Node-familiar naming. You can use the underlying library directly — see the package overview for escape hatches.

Back to queue package overview

MIT Licensed · Built for Node.js developers moving to Go