Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Pietrek <[email protected]>
  • Loading branch information
Jarema committed Nov 21, 2022
1 parent 762b146 commit aebbe14
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 33 deletions.
5 changes: 0 additions & 5 deletions .config/nats.dic
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ get_raw_message
max_bytes
>
=
'*',
'.',
.',
\*
&
+
100ms
1ms
Expand Down
2 changes: 1 addition & 1 deletion async-nats/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Hence it was renamed to `Event::Connected`, which describes the current state wi
For consistency, `Event::Disconnect` was renamed to `Event::Disconnected`.

## Breaking changes
* Defer publish acknowledgements by @Jarema in https://github.com/nats-io/nats.rs/pull/644
* Defer publish acknowledgments by @Jarema in https://github.com/nats-io/nats.rs/pull/644
* Add retry on initial connect by @Jarema in https://github.com/nats-io/nats.rs/pull/662
## Added
* Add support for mirrors and sources in Key Value Store by @Jarema in https://github.com/nats-io/nats.rs/pull/676
Expand Down
10 changes: 5 additions & 5 deletions async-nats/src/jetstream/consumer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ pub struct Info {
pub ack_floor: SequenceInfo,
/// The difference between delivered and acknowledged messages
pub num_ack_pending: usize,
/// The number of messages re-sent after acknowledgement was not received within the configured
/// The number of messages re-sent after acknowledgment was not received within the configured
/// time threshold
pub num_redelivered: usize,
/// The number of waiting
Expand Down Expand Up @@ -198,15 +198,15 @@ pub struct Config {
/// to be "push-based". This is analogous in some ways to a normal
/// NATS subscription (rather than a queue subscriber) in that the
/// consumer will receive all messages published to the stream that
/// the consumer is interested in. Acknowledgement policies such as
/// the consumer is interested in. Acknowledgment policies such as
/// `AckPolicy::None` and `AckPolicy::All` may be enabled for such
/// push-based consumers, which reduce the amount of effort spent
/// tracking delivery. Combining `AckPolicy::All` with
/// `Consumer::process_batch` enables particularly nice throughput
/// optimizations.
///
/// Setting `deliver_subject` to `None` will cause this consumer to
/// be "pull-based", and will require explicit acknowledgement of
/// be "pull-based", and will require explicit acknowledgment of
/// each message. This is analogous in some ways to a normal NATS
/// queue subscriber, where a message will be delivered to a single
/// subscriber. Pull-based consumers are intended to be used for
Expand Down Expand Up @@ -273,7 +273,7 @@ pub struct Config {
/// The rate of message delivery in bits per second
#[serde(default, skip_serializing_if = "is_default")]
pub rate_limit: u64,
/// What percentage of acknowledgements should be samples for observability, 0-100
/// What percentage of acknowledgments should be samples for observability, 0-100
#[serde(default, skip_serializing_if = "is_default")]
pub sample_frequency: u8,
/// The maximum number of waiting consumers.
Expand Down Expand Up @@ -399,7 +399,7 @@ pub enum AckPolicy {
#[serde(rename = "none")]
None = 0,
/// Acknowledges all messages with lower sequence numbers when a later
/// message is acknowledged. Useful for "batching" acknowledgement.
/// message is acknowledged. Useful for "batching" acknowledgment.
#[serde(rename = "all")]
All = 1,
}
Expand Down
2 changes: 1 addition & 1 deletion async-nats/src/jetstream/consumer/pull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@ pub struct Config {
/// The rate of message delivery in bits per second
#[serde(default, skip_serializing_if = "is_default")]
pub rate_limit: u64,
/// What percentage of acknowledgements should be samples for observability, 0-100
/// What percentage of acknowledgments should be samples for observability, 0-100
#[serde(default, skip_serializing_if = "is_default")]
pub sample_frequency: u8,
/// The maximum number of waiting consumers.
Expand Down
4 changes: 2 additions & 2 deletions async-nats/src/jetstream/consumer/push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ pub struct Config {
/// The rate of message delivery in bits per second
#[serde(default, skip_serializing_if = "is_default")]
pub rate_limit: u64,
/// What percentage of acknowledgements should be samples for observability, 0-100
/// What percentage of acknowledgments should be samples for observability, 0-100
#[serde(default, skip_serializing_if = "is_default")]
pub sample_frequency: u8,
/// The maximum number of waiting consumers.
Expand Down Expand Up @@ -305,7 +305,7 @@ pub struct OrderedConfig {
/// The rate of message delivery in bits per second
#[serde(default, skip_serializing_if = "is_default")]
pub rate_limit: u64,
/// What percentage of acknowledgements should be samples for observability, 0-100
/// What percentage of acknowledgments should be samples for observability, 0-100
#[serde(default, skip_serializing_if = "is_default")]
pub sample_frequency: u8,
/// Only deliver headers without payloads.
Expand Down
2 changes: 1 addition & 1 deletion async-nats/src/jetstream/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use serde::{Deserialize, Serialize};
use std::ops::Not;

/// `PublishAck` is an acknowledgement received after successfully publishing a message.
/// `PublishAck` is an acknowledgment received after successfully publishing a message.
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq, Eq)]
pub struct PublishAck {
/// Name of stream the message was published to.
Expand Down
4 changes: 2 additions & 2 deletions async-nats/src/jetstream/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@ pub struct ClusterInfo {
pub struct PeerInfo {
/// The server name of the peer.
pub name: String,
/// Indicates if the server is up to date and synchronised.
/// Indicates if the server is up to date and synchronized.
pub current: bool,
/// Nanoseconds since this peer was last seen.
#[serde(with = "serde_nanos")]
Expand All @@ -1203,7 +1203,7 @@ pub struct PeerInfo {
pub lag: Option<u64>,
}

/// The response generated by trying ot purge a stream.
/// The response generated by trying to purge a stream.
#[derive(Debug, Serialize, Deserialize, Clone, Copy)]
pub struct PurgeResponse {
/// Whether the purge request was successful.
Expand Down
2 changes: 1 addition & 1 deletion async-nats/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ impl std::fmt::Display for ServerError {
/// Info to construct a CONNECT message.
#[derive(Clone, Debug, Serialize)]
pub struct ConnectInfo {
/// Turns on +OK protocol acknowledgements.
/// Turns on +OK protocol acknowledgments.
pub verbose: bool,

/// Turns on additional strict format checking, e.g. for properly formed
Expand Down
2 changes: 1 addition & 1 deletion async-nats/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl StatusCode {
.ok_or_else(InvalidStatusCode::new)
}

/// Converts a &[u8] to a status code
/// Converts a `&[u8]` to a status code
pub fn from_bytes(src: &[u8]) -> Result<StatusCode, InvalidStatusCode> {
if src.len() != 3 {
return Err(InvalidStatusCode::new());
Expand Down
2 changes: 1 addition & 1 deletion nats/nats_test_server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn is_empty_or_none(field: &Option<String>) -> bool {
#[doc(hidden)]
#[allow(clippy::module_name_repetitions)]
pub struct ConnectInfo {
/// Turns on +OK protocol acknowledgements.
/// Turns on +OK protocol acknowledgments.
pub verbose: bool,

/// Turns on additional strict format checking, e.g. for properly formed
Expand Down
2 changes: 1 addition & 1 deletion nats/src/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::SecureString;
#[doc(hidden)]
#[allow(clippy::module_name_repetitions)]
pub struct ConnectInfo {
/// Turns on +OK protocol acknowledgements.
/// Turns on +OK protocol acknowledgments.
pub verbose: bool,

/// Turns on additional strict format checking, e.g. for properly formed
Expand Down
2 changes: 1 addition & 1 deletion nats/src/jetstream/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ pub enum ErrorCode {
ConsumerWQConsumerNotDeliverAll = 10101,
/// Consumer name is too long, maximum allowed is {max}
ConsumerNameTooLong = 10102,
/// Durable name can not contain '.', '*', '>'
/// Durable name can not contain `.`, `*`, `>`
ConsumerBadDurableName = 10103,
/// Error creating store for consumer: {err}
ConsumerStoreFailed = 10104,
Expand Down
16 changes: 8 additions & 8 deletions nats/src/jetstream/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ pub struct ConsumerConfig {
/// to be "push-based". This is analogous in some ways to a normal
/// NATS subscription (rather than a queue subscriber) in that the
/// consumer will receive all messages published to the stream that
/// the consumer is interested in. Acknowledgement policies such as
/// the consumer is interested in. Acknowledgment policies such as
/// `AckPolicy::None` and `AckPolicy::All` may be enabled for such
/// push-based consumers, which reduce the amount of effort spent
/// tracking delivery. Combining `AckPolicy::All` with
/// `Consumer::process_batch` enables particularly nice throughput
/// optimizations.
///
/// Setting `deliver_subject` to `None` will cause this consumer to
/// be "pull-based", and will require explicit acknowledgement of
/// be "pull-based", and will require explicit acknowledgment of
/// each message. This is analogous in some ways to a normal NATS
/// queue subscriber, where a message will be delivered to a single
/// subscriber. Pull-based consumers are intended to be used for
Expand Down Expand Up @@ -223,7 +223,7 @@ pub struct ConsumerConfig {
/// The rate of message delivery in bits per second
#[serde(default, skip_serializing_if = "is_default")]
pub rate_limit: u64,
/// What percentage of acknowledgements should be samples for observability, 0-100
/// What percentage of acknowledgments should be samples for observability, 0-100
#[serde(default, skip_serializing_if = "is_default")]
pub sample_frequency: u8,
/// The maximum number of waiting consumers.
Expand Down Expand Up @@ -488,7 +488,7 @@ pub enum AckPolicy {
#[serde(rename = "none")]
None = 0,
/// Acknowledges all messages with lower sequence numbers when a later
/// message is acknowledged. Useful for "batching" acknowledgement.
/// message is acknowledged. Useful for "batching" acknowledgment.
#[serde(rename = "all")]
All = 1,
}
Expand Down Expand Up @@ -536,7 +536,7 @@ pub struct PurgeRequest {
pub keep: Option<u64>,
}

/// The response generated by trying ot purge a stream.
/// The response generated by trying to purge a stream.
#[derive(Debug, Serialize, Deserialize, Clone, Copy)]
pub struct PurgeResponse {
/// Whether the purge request was successful.
Expand Down Expand Up @@ -626,7 +626,7 @@ pub(crate) struct AccountStats {
pub limits: AccountLimits,
}

/// `PublishAck` is an acknowledgement received after successfully publishing a message.
/// `PublishAck` is an acknowledgment received after successfully publishing a message.
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq, Eq)]
pub struct PublishAck {
/// Name of stream the message was published to.
Expand Down Expand Up @@ -697,7 +697,7 @@ pub struct ConsumerInfo {
pub ack_floor: SequencePair,
/// The difference between delivered and acknowledged messages
pub num_ack_pending: usize,
/// The number of messages re-sent after acknowledgement was not received within the configured
/// The number of messages re-sent after acknowledgment was not received within the configured
/// time threshold
pub num_redelivered: usize,
/// The number of waiting
Expand Down Expand Up @@ -781,7 +781,7 @@ pub(crate) struct StreamNamesResponse {
pub streams: Option<Vec<String>>,
}

/// Options to configure Pull Subsscription
/// Options to configure Pull Subscription
#[derive(Debug, Default, Clone)]
pub struct PullSubscribeOptions {
pub(crate) stream_name: Option<String>,
Expand Down
6 changes: 3 additions & 3 deletions nats/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl Message {
false
}

/// Acknowledge a `JetStream` message with a default acknowledgement.
/// Acknowledge a `JetStream` message with a default acknowledgment.
/// See `AckKind` documentation for details of what other types of
/// acks are available. If you need to send a non-default ack, use
/// the `ack_kind` method below. If you need to block until the
Expand All @@ -202,8 +202,8 @@ impl Message {
self.respond(ack_kind)
}

/// Acknowledge a `JetStream` message and wait for acknowledgement from the server
/// that it has received our ack. Retry acknowledgement until we receive a response.
/// Acknowledge a `JetStream` message and wait for acknowledgment from the server
/// that it has received our ack. Retry acknowledgment until we receive a response.
/// See `AckKind` documentation for details of what each variant means.
///
/// Returns immediately if this message has already been double-acked.
Expand Down

0 comments on commit aebbe14

Please sign in to comment.