From going through the source, it looks like the payload is the cmd. Can those be multiple words or will it read each word as a separate argument.
handler := s.Router.Handler(cmd.Name)
reply, err := handler.Exec(cmd)
From going through the source, it looks like the payload is the cmd. Can those be multiple words or will it read each word as a separate argument.
handler := s.Router.Handler(cmd.Name)
reply, err := handler.Exec(cmd)
"ping" here is just a message, not the name of a system command/executable - in this case the worker receives the "ping" request, and just replies with a "pong" message - both sides are code you need to write.
You can encode whatever you want in the payload, json, simple plaintext - it's up to the client and the worker to agree on the meaning.
The ping example was just given so I could enqueue a job named “ping” as a client and respond with a “pong” text result from a worker. Just a silly example :). Real use cases would be background jobs such as sending emails, http downloads, image resizing…etc.