Skip to content

Commit

Permalink
fix some typos (Cylix#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
steple authored and Cylix committed Sep 17, 2018
1 parent e8ebe35 commit e41d37f
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion examples/cpp_redis_high_availability_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ main(void) {
//! Enable logging
cpp_redis::active_logger = std::unique_ptr<cpp_redis::logger>(new cpp_redis::logger);

//! High availablity requires at least 2 io service workers
//! High availability requires at least 2 io service workers
cpp_redis::network::set_default_nb_workers(2);

cpp_redis::client client;
Expand Down
24 changes: 12 additions & 12 deletions includes/cpp_redis/core/client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class client {
//!
//! high availability (re)connection states
//! * dropped: connection has dropped
//! * start: attemp of connection has started
//! * sleeping: sleep between two attemps
//! * start: attempt of connection has started
//! * sleeping: sleep between two attempts
//! * ok: connected
//! * failed: failed to connect
//! * lookup failed: failed to retrieve master sentinel
Expand Down Expand Up @@ -112,8 +112,8 @@ class client {
//! \param port port to be connected to
//! \param connect_callback connect handler to be called on connect events (may be null)
//! \param timeout_msecs maximum time to connect
//! \param max_reconnects maximum attemps of reconnection if connection dropped
//! \param reconnect_interval_msecs time between two attemps of reconnection
//! \param max_reconnects maximum attempts of reconnection if connection dropped
//! \param reconnect_interval_msecs time between two attempts of reconnection
//!
void connect(
const std::string& host = "127.0.0.1",
Expand All @@ -129,8 +129,8 @@ class client {
//! \param name sentinel name
//! \param connect_callback connect handler to be called on connect events (may be null)
//! \param timeout_msecs maximum time to connect
//! \param max_reconnects maximum attemps of reconnection if connection dropped
//! \param reconnect_interval_msecs time between two attemps of reconnection
//! \param max_reconnects maximum attempts of reconnection if connection dropped
//! \param reconnect_interval_msecs time between two attempts of reconnection
//!
void connect(
const std::string& name,
Expand All @@ -152,7 +152,7 @@ class client {
void disconnect(bool wait_for_removal = false);

//!
//! \return whether an attemp to reconnect is in progress
//! \return whether an attempt to reconnect is in progress
//!
bool is_reconnecting(void) const;

Expand Down Expand Up @@ -245,7 +245,7 @@ class client {
void resend_failed_commands(void);

//!
//! sleep between two reconnect attemps if necessary
//! sleep between two reconnect attempts if necessary
//!
void sleep_before_next_reconnect_attempt(void);

Expand Down Expand Up @@ -1357,7 +1357,7 @@ class client {
void connection_receive_handler(network::redis_connection& connection, reply& reply);

//!
//! redis_connection disconnection handler, triggered whenever a disconnection occured
//! redis_connection disconnection handler, triggered whenever a disconnection occurred
//!
//! \param connection redis_connection instance
//!
Expand Down Expand Up @@ -1423,15 +1423,15 @@ class client {
//!
std::uint32_t m_connect_timeout_msecs = 0;
//!
//! max number of reconnection attemps
//! max number of reconnection attempts
//!
std::int32_t m_max_reconnects = 0;
//!
//! current number of attemps to reconect
//! current number of attempts to reconnect
//!
std::int32_t m_current_reconnect_attempts = 0;
//!
//! time between two reconnection attemps
//! time between two reconnection attempts
//!
std::uint32_t m_reconnect_interval_msecs = 0;

Expand Down
4 changes: 2 additions & 2 deletions includes/cpp_redis/core/sentinel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class sentinel {
std::uint32_t timeout_msecs = 0);

//!
//! Used to find the current redis master by asking one or more sentinels. Use high availablity.
//! Used to find the current redis master by asking one or more sentinels. Use high availability.
//! Handles connect() and disconnect() automatically when autoconnect=true
//! This method is synchronous. No need to call sync_commit() or process a reply callback.
//! Call add_sentinel() before using when autoconnect==true
Expand Down Expand Up @@ -285,7 +285,7 @@ class sentinel {
void connection_receive_handler(network::redis_connection& connection, reply& reply);

//!
//! redis_connection disconnection handler, triggered whenever a disconnection occured
//! redis_connection disconnection handler, triggered whenever a disconnection occurred
//!
//! \param connection redis_connection instance
//!
Expand Down
26 changes: 13 additions & 13 deletions includes/cpp_redis/core/subscriber.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class subscriber {
//!
//! high availability (re)connection states
//! * dropped: connection has dropped
//! * start: attemp of connection has started
//! * sleeping: sleep between two attemps
//! * start: attempt of connection has started
//! * sleeping: sleep between two attempts
//! * ok: connected
//! * failed: failed to connect
//! * lookup failed: failed to retrieve master sentinel
Expand Down Expand Up @@ -96,8 +96,8 @@ class subscriber {
//! \param port port to be connected to
//! \param connect_callback connect handler to be called on connect events (may be null)
//! \param timeout_msecs maximum time to connect
//! \param max_reconnects maximum attemps of reconnection if connection dropped
//! \param reconnect_interval_msecs time between two attemps of reconnection
//! \param max_reconnects maximum attempts of reconnection if connection dropped
//! \param reconnect_interval_msecs time between two attempts of reconnection
//!
void connect(
const std::string& host = "127.0.0.1",
Expand All @@ -113,8 +113,8 @@ class subscriber {
//! \param name sentinel name
//! \param connect_callback connect handler to be called on connect events (may be null)
//! \param timeout_msecs maximum time to connect
//! \param max_reconnects maximum attemps of reconnection if connection dropped
//! \param reconnect_interval_msecs time between two attemps of reconnection
//! \param max_reconnects maximum attempts of reconnection if connection dropped
//! \param reconnect_interval_msecs time between two attempts of reconnection
//!
void connect(
const std::string& name,
Expand All @@ -136,7 +136,7 @@ class subscriber {
void disconnect(bool wait_for_removal = false);

//!
//! \return whether an attemp to reconnect is in progress
//! \return whether an attempt to reconnect is in progress
//!
bool is_reconnecting(void) const;

Expand Down Expand Up @@ -170,7 +170,7 @@ class subscriber {
typedef std::function<void(const std::string&, const std::string&)> subscribe_callback_t;

//!
//! acknowledgement callback called whenever a subscribe completes
//! acknowledgment callback called whenever a subscribe completes
//! takes as parameter the int returned by the redis server (usually the number of channels you are subscribed to)
//!
typedef std::function<void(int64_t)> acknowledgement_callback_t;
Expand Down Expand Up @@ -276,7 +276,7 @@ class subscriber {
void connection_receive_handler(network::redis_connection& connection, reply& reply);

//!
//! redis_connection disconnection handler, triggered whenever a disconnection occured
//! redis_connection disconnection handler, triggered whenever a disconnection occurred
//!
//! \param connection redis_connection instance
//!
Expand Down Expand Up @@ -339,7 +339,7 @@ class subscriber {
bool should_reconnect(void) const;

//!
//! sleep between two reconnect attemps if necessary
//! sleep between two reconnect attempts if necessary
//!
void sleep_before_next_reconnect_attempt(void);

Expand Down Expand Up @@ -402,15 +402,15 @@ class subscriber {
//!
std::uint32_t m_connect_timeout_msecs = 0;
//!
//! max number of reconnection attemps
//! max number of reconnection attempts
//!
std::int32_t m_max_reconnects = 0;
//!
//! current number of attemps to reconect
//! current number of attempts to reconnect
//!
std::int32_t m_current_reconnect_attempts = 0;
//!
//! time between two reconnection attemps
//! time between two reconnection attempts
//!
std::uint32_t m_reconnect_interval_msecs = 0;

Expand Down
8 changes: 4 additions & 4 deletions includes/cpp_redis/misc/logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ extern std::unique_ptr<logger_iface> active_logger;

//!
//! debug logging
//! convenience function used internaly to call the logger
//! convenience function used internally to call the logger
//!
//! \param msg message to be logged
//! \param file file from which the message is coming
Expand All @@ -175,7 +175,7 @@ void debug(const std::string& msg, const std::string& file, std::size_t line);

//!
//! info logging
//! convenience function used internaly to call the logger
//! convenience function used internally to call the logger
//!
//! \param msg message to be logged
//! \param file file from which the message is coming
Expand All @@ -185,7 +185,7 @@ void info(const std::string& msg, const std::string& file, std::size_t line);

//!
//! warn logging
//! convenience function used internaly to call the logger
//! convenience function used internally to call the logger
//!
//! \param msg message to be logged
//! \param file file from which the message is coming
Expand All @@ -195,7 +195,7 @@ void warn(const std::string& msg, const std::string& file, std::size_t line);

//!
//! error logging
//! convenience function used internaly to call the logger
//! convenience function used internally to call the logger
//!
//! \param msg message to be logged
//! \param file file from which the message is coming
Expand Down
4 changes: 2 additions & 2 deletions includes/cpp_redis/network/redis_connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class redis_connection {

//!
//! tcp_client disconnection handler
//! called by the tcp_client whenever a disconnection occured
//! called by the tcp_client whenever a disconnection occurred
//!
void tcp_client_disconnection_handler(void);

Expand Down Expand Up @@ -160,7 +160,7 @@ class redis_connection {
reply_callback_t m_reply_callback;

//!
//! disconnection handler whenever a disconnection occured
//! disconnection handler whenever a disconnection occurred
//!
disconnection_handler_t m_disconnection_handler;

Expand Down
6 changes: 3 additions & 3 deletions sources/core/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ client::client(const std::shared_ptr<network::tcp_client_iface>& tcp_client)
}

client::~client(void) {
//! ensure we stopped reconnection attemps
//! ensure we stopped reconnection attempts
if (!m_cancel) {
cancel_reconnect();
}
Expand Down Expand Up @@ -168,7 +168,7 @@ client&
client::send(const std::vector<std::string>& redis_cmd, const reply_callback_t& callback) {
std::lock_guard<std::mutex> lock_callback(m_callbacks_mutex);

__CPP_REDIS_LOG(info, "cpp_redis::client attemps to store new command in the send buffer");
__CPP_REDIS_LOG(info, "cpp_redis::client attempts to store new command in the send buffer");
unprotected_send(redis_cmd, callback);
__CPP_REDIS_LOG(info, "cpp_redis::client stored new command in the send buffer");

Expand Down Expand Up @@ -386,7 +386,7 @@ client::re_select(void) {

void
client::reconnect(void) {
//! increase the number of attemps to reconnect
//! increase the number of attempts to reconnect
++m_current_reconnect_attempts;


Expand Down
14 changes: 7 additions & 7 deletions sources/core/subscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ subscriber::subscriber(const std::shared_ptr<network::tcp_client_iface>& tcp_cli
}

subscriber::~subscriber(void) {
//! ensure we stopped reconnection attemps
//! ensure we stopped reconnection attempts
if (!m_cancel) {
cancel_reconnect();
}
Expand Down Expand Up @@ -179,7 +179,7 @@ subscriber&
subscriber::subscribe(const std::string& channel, const subscribe_callback_t& callback, const acknowledgement_callback_t& acknowledgement_callback) {
std::lock_guard<std::mutex> lock(m_subscribed_channels_mutex);

__CPP_REDIS_LOG(debug, "cpp_redis::subscriber attemps to subscribe to channel " + channel);
__CPP_REDIS_LOG(debug, "cpp_redis::subscriber attempts to subscribe to channel " + channel);
unprotected_subscribe(channel, callback, acknowledgement_callback);
__CPP_REDIS_LOG(info, "cpp_redis::subscriber subscribed to channel " + channel);

Expand All @@ -196,7 +196,7 @@ subscriber&
subscriber::psubscribe(const std::string& pattern, const subscribe_callback_t& callback, const acknowledgement_callback_t& acknowledgement_callback) {
std::lock_guard<std::mutex> lock(m_psubscribed_channels_mutex);

__CPP_REDIS_LOG(debug, "cpp_redis::subscriber attemps to psubscribe to channel " + pattern);
__CPP_REDIS_LOG(debug, "cpp_redis::subscriber attempts to psubscribe to channel " + pattern);
unprotected_psubscribe(pattern, callback, acknowledgement_callback);
__CPP_REDIS_LOG(info, "cpp_redis::subscriber psubscribed to channel " + pattern);

Expand All @@ -213,7 +213,7 @@ subscriber&
subscriber::unsubscribe(const std::string& channel) {
std::lock_guard<std::mutex> lock(m_subscribed_channels_mutex);

__CPP_REDIS_LOG(debug, "cpp_redis::subscriber attemps to unsubscribe from channel " + channel);
__CPP_REDIS_LOG(debug, "cpp_redis::subscriber attempts to unsubscribe from channel " + channel);
auto it = m_subscribed_channels.find(channel);
if (it == m_subscribed_channels.end()) {
__CPP_REDIS_LOG(debug, "cpp_redis::subscriber was not subscribed to channel " + channel);
Expand All @@ -231,7 +231,7 @@ subscriber&
subscriber::punsubscribe(const std::string& pattern) {
std::lock_guard<std::mutex> lock(m_psubscribed_channels_mutex);

__CPP_REDIS_LOG(debug, "cpp_redis::subscriber attemps to punsubscribe from channel " + pattern);
__CPP_REDIS_LOG(debug, "cpp_redis::subscriber attempts to punsubscribe from channel " + pattern);
auto it = m_psubscribed_channels.find(pattern);
if (it == m_psubscribed_channels.end()) {
__CPP_REDIS_LOG(debug, "cpp_redis::subscriber was not psubscribed to channel " + pattern);
Expand Down Expand Up @@ -356,7 +356,7 @@ subscriber::connection_receive_handler(network::redis_connection&, reply& reply)

//! always return an array
//! otherwise, if auth was defined, this should be the AUTH reply
//! any other replies from the server are considered as unexepected
//! any other replies from the server are considered as unexpected
if (!reply.is_array()) {
if (m_auth_reply_callback) {
__CPP_REDIS_LOG(debug, "cpp_redis::subscriber executes auth callback");
Expand Down Expand Up @@ -447,7 +447,7 @@ subscriber::should_reconnect(void) const {

void
subscriber::reconnect(void) {
//! increase the number of attemps to reconnect
//! increase the number of attempts to reconnect
++m_current_reconnect_attempts;

//! We rely on the sentinel to tell us which redis server is currently the master.
Expand Down

0 comments on commit e41d37f

Please sign in to comment.