Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CHANGED] MaxPubAcksInFlight to MaxPubAcksInflight #92

Merged
merged 1 commit into from
Jul 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions examples/stan-bench.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,9 @@ func main() {
}
}

func setMaxPubAcksInflight(val int) stan.Option {
return func(o *stan.Options) error {
o.MaxPubAcksInflight = val
return nil
}
}

func runPublisher(startwg, donewg *sync.WaitGroup, opts nats.Options, numMsgs int, msgSize int, async bool, pubID string, maxPubAcksInFlight int) {
func runPublisher(startwg, donewg *sync.WaitGroup, opts nats.Options, numMsgs int, msgSize int, async bool, pubID string, maxPubAcksInflight int) {

snc, err := stan.Connect("test-cluster", pubID, setMaxPubAcksInflight(maxPubAcksInFlight))
snc, err := stan.Connect("test-cluster", pubID, stan.MaxPubAcksInflight(maxPubAcksInflight))
if err != nil {
log.Fatalf("Publisher %s can't connect: %v\n", pubID, err)
}
Expand Down
4 changes: 2 additions & 2 deletions stan.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ func PubAckWait(t time.Duration) Option {
}
}

// MaxPubAcksInFlight is an Option to set the maximum number of published
// MaxPubAcksInflight is an Option to set the maximum number of published
// messages without outstanding ACKs from the server.
func MaxPubAcksInFlight(max int) Option {
func MaxPubAcksInflight(max int) Option {
return func(o *Options) error {
o.MaxPubAcksInflight = max
return nil
Expand Down
8 changes: 4 additions & 4 deletions stan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ func TestRedelivery(t *testing.T) {
}
}

func TestRedeliveryHonorMaxInFlight(t *testing.T) {
func TestRedeliveryHonorMaxInflight(t *testing.T) {
// Run a NATS Streaming server
s := RunServer(clusterName)
defer s.Shutdown()
Expand Down Expand Up @@ -1889,7 +1889,7 @@ func TestNatsConn(t *testing.T) {
}
}

func TestMaxPubAcksInFlight(t *testing.T) {
func TestMaxPubAcksInflight(t *testing.T) {
s := RunServer(clusterName)
defer s.Shutdown()

Expand All @@ -1900,7 +1900,7 @@ func TestMaxPubAcksInFlight(t *testing.T) {
defer nc.Close()

sc, err := Connect(clusterName, clientName,
MaxPubAcksInFlight(1),
MaxPubAcksInflight(1),
PubAckWait(time.Second),
NatsConn(nc))
if err != nil {
Expand All @@ -1914,7 +1914,7 @@ func TestMaxPubAcksInFlight(t *testing.T) {

msg := []byte("hello")

// Send more than one message, if MaxPubAcksInFlight() works, one
// Send more than one message, if MaxPubAcksInflight() works, one
// of the publish call should block for up to PubAckWait.
start := time.Now()
for i := 0; i < 2; i++ {
Expand Down