WithExpectLastSequence sets the expected sequence number the last message on a stream should have. If the last message has a different sequence number server will reject the message and publish will fail.
(seq uint64)
| 630 | // on a stream should have. If the last message has a different sequence number |
| 631 | // server will reject the message and publish will fail. |
| 632 | func WithExpectLastSequence(seq uint64) PublishOpt { |
| 633 | return func(opts *pubOpts) error { |
| 634 | opts.lastSeq = &seq |
| 635 | return nil |
| 636 | } |
| 637 | } |
| 638 | |
| 639 | // WithExpectLastSequencePerSubject sets the expected sequence number the last |
| 640 | // message on a subject the message is published to. If the last message on a |
no outgoing calls