This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "log" | |
| "os" | |
| "os/signal" | |
| "runtime" | |
| "syscall" | |
| "github.com/nats-io/go-nats" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // All subscriptions with the same queue name will form a queue | |
| // group at runtime. Each message will be delivered to only one | |
| // subscriber per queue group. You can have as many queue groups | |
| // as you wish, and as many members in a single group as you like. | |
| // Normal subscribers will continue to work as expected. | |
| nc.QueueSubscribe("foo", "job_workers", func(m *Msg) { | |
| // Do some work, then send reply. | |
| nc.Publish(m.ReplyTo, myAnswer) | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright 2012-2018 The NATS Authors | |
| // Licensed under the Apache License, Version 2.0 (the "License"); | |
| // you may not use this file except in compliance with the License. | |
| // You may obtain a copy of the License at | |
| // | |
| // http://www.apache.org/licenses/LICENSE-2.0 | |
| // | |
| // Unless required by applicable law or agreed to in writing, software | |
| // distributed under the License is distributed on an "AS IS" BASIS, | |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
OlderNewer