Skip to content

chore: fix typos #1076

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

Merged
merged 1 commit into from
Dec 28, 2024
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
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ concurrent-ruby-edge:
* Simplification of `RubySingleThreadExecutor`
* `Async` improvements
- Each object uses its own `SingleThreadExecutor` instead of the global thread pool.
- No longers supports executor injection
- No longer supports executor injection
- Much better documentation
* `Atom` updates
- No longer `Dereferenceable`
Expand Down Expand Up @@ -471,7 +471,7 @@ Please see the [roadmap](https://github.com/ruby-concurrency/concurrent-ruby/iss
* Fixed bug with return value of `Concurrent::Actor::Utils::Pool#ask`
* Fixed timing bug in `TimerTask`
* Fixed bug when creating a `JavaThreadPoolExecutor` with minimum pool size of zero
* Removed confusing warning when not using native extenstions
* Removed confusing warning when not using native extensions
* Improved documentation

## Release v0.7.0 (13 August 2014)
Expand Down
2 changes: 1 addition & 1 deletion docs-source/erlang_actor.in.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ The one exception from the original Erlang naming is exit.
To avoid clashing with `Kernel#exit` it's called `terminate`.

Until there is more information available here, the chapters listed below from
a book [lern you some Erlang](https://learnyousomeerlang.com)
a book [learn you some Erlang](https://learnyousomeerlang.com)
are excellent source of information.
The Ruby ErlangActor implementation has same behaviour.

Expand Down
2 changes: 1 addition & 1 deletion docs-source/erlang_actor.out.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ The one exception from the original Erlang naming is exit.
To avoid clashing with `Kernel#exit` it's called `terminate`.

Until there is more information available here, the chapters listed below from
a book [lern you some Erlang](https://learnyousomeerlang.com)
a book [learn you some Erlang](https://learnyousomeerlang.com)
are excellent source of information.
The Ruby ErlangActor implementation has same behaviour.

Expand Down
2 changes: 1 addition & 1 deletion examples/benchmark_atomic_1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def para_prepare(&block)
# NOTE: It seems to me that this measurement method
# is sensible to how the system dispatches his resources.
#
# More precise caluclation could be done using
# More precise calculation could be done using
# getrusage's times
ret = Benchmark.measure do
$go = true
Expand Down
2 changes: 1 addition & 1 deletion examples/graph_atomic_bench.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
end
elsif conf[:vary] == "speed"
# Varies the execution time of the update block
# by using long calulation (MD5)
# by using long calculation (MD5)
#
# NOTE: Thread.pass and sleep() are not usable by the atomic
# lock. It needs to run the whole block without hitting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ public static interface Spliterator<T> extends Iterator<T> {
*
* Maintaining API and serialization compatibility with previous
* versions of this class introduces several oddities. Mainly: We
* leave untouched but unused constructor arguments refering to
* leave untouched but unused constructor arguments referring to
* concurrencyLevel. We accept a loadFactor constructor argument,
* but apply it only to initial table capacity (which is the only
* time that we can guarantee to honor it.) We also declare an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ public static interface Spliterator<T> extends Iterator<T> {
*
* Maintaining API and serialization compatibility with previous
* versions of this class introduces several oddities. Mainly: We
* leave untouched but unused constructor arguments refering to
* leave untouched but unused constructor arguments referring to
* concurrencyLevel. We accept a loadFactor constructor argument,
* but apply it only to initial table capacity (which is the only
* time that we can guarantee to honor it.) We also declare an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def next_node
@SuccessorReference.value
end

# This method provides a unqiue key for the data which will be used for
# This method provides a unique key for the data which will be used for
# ordering. This is configurable, and changes depending on how you wish
# the nodes to be ordered.
def key_for(data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module OldChannelIntegration

# @!visibility private

# Zips with selected value form the suplied channels
# Zips with selected value form the supplied channels
# @return [Future]
def then_select(*channels)
future = Concurrent::Promises.select(*channels)
Expand Down
4 changes: 2 additions & 2 deletions lib/concurrent-ruby/concurrent/agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def await_for(timeout)
# @param [Float] timeout the maximum number of seconds to wait
# @return [Boolean] true if all actions complete before timeout
#
# @raise [Concurrent::TimeoutError] when timout is reached
# @raise [Concurrent::TimeoutError] when timeout is reached
#
# @!macro agent_await_warning
def await_for!(timeout)
Expand Down Expand Up @@ -477,7 +477,7 @@ def await_for(timeout, *agents)
# @param [Array<Concurrent::Agent>] agents the Agents on which to wait
# @return [Boolean] true if all actions complete before timeout
#
# @raise [Concurrent::TimeoutError] when timout is reached
# @raise [Concurrent::TimeoutError] when timeout is reached
# @!macro agent_await_warning
def await_for!(timeout, *agents)
raise Concurrent::TimeoutError unless await_for(timeout, *agents)
Expand Down
2 changes: 1 addition & 1 deletion lib/concurrent-ruby/concurrent/async.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ module Async

# @!method self.new(*args, &block)
#
# Instanciate a new object and ensure proper initialization of the
# Instantiate a new object and ensure proper initialization of the
# synchronization mechanisms.
#
# @param [Array<Object>] args Zero or more arguments to be passed to the
Expand Down
2 changes: 1 addition & 1 deletion lib/concurrent-ruby/concurrent/atom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class Atom < Synchronization::Object
# @option opts [Proc] :validator (nil) Optional proc used to validate new
# values. It must accept one and only one argument which will be the
# intended new value. The validator will return true if the new value
# is acceptable else return false (preferrably) or raise an exception.
# is acceptable else return false (preferably) or raise an exception.
#
# @!macro deref_options
#
Expand Down
2 changes: 1 addition & 1 deletion lib/concurrent-ruby/concurrent/delay.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module Concurrent
#
# When a `Delay` is created its state is set to `pending`. The value and
# reason are both `nil`. The first time the `#value` method is called the
# enclosed opration will be run and the calling thread will block. Other
# enclosed operation will be run and the calling thread will block. Other
# threads attempting to call `#value` will block as well. Once the operation
# is complete the *value* will be set to the result of the operation or the
# *reason* will be set to the raised exception, as appropriate. All threads
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ module Concurrent
#
# This is a no-op on some pool implementation (e.g. the Java one). The Ruby
# pool will auto-prune each time a new job is posted. You will need to call
# this method explicitely in case your application post jobs in bursts (a
# this method explicitly in case your application post jobs in bursts (a
# lot of jobs and then nothing for long periods)

# @!macro thread_pool_executor_public_api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module Concurrent
# is received. This pattern has several issues. The thread itself is highly
# susceptible to errors during processing. Also, the thread itself must be
# constantly monitored and restarted should it die. `SingleThreadExecutor`
# encapsulates all these bahaviors. The task processor is highly resilient
# encapsulates all these behaviors. The task processor is highly resilient
# to errors from within tasks. Also, should the thread die it will
# automatically be restarted.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/concurrent-ruby/concurrent/map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def [](key)
if value = super # non-falsy value is an existing mapping, return it right away
value
# re-check is done with get_or_default(key, NULL) instead of a simple !key?(key) in order to avoid a race condition, whereby by the time the current thread gets to the key?(key) call
# a key => value mapping might have already been created by a different thread (key?(key) would then return true, this elsif branch wouldn't be taken and an incorrent +nil+ value
# a key => value mapping might have already been created by a different thread (key?(key) would then return true, this elsif branch wouldn't be taken and an incorrect +nil+ value
# would be returned)
# note: nil == value check is not technically necessary
elsif @default_proc && nil == value && NULL == (value = get_or_default(key, NULL))
Expand Down
2 changes: 1 addition & 1 deletion lib/concurrent-ruby/concurrent/promise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ module Concurrent
# - if parent is *rejected* the child will be *pending* (but will ultimately be *rejected*)
#
# Promises are executed asynchronously from the main thread. By the time a
# child Promise finishes intialization it may be in a different state than its
# child Promise finishes initialization it may be in a different state than its
# parent (by the time a child is created its parent may have completed
# execution and changed state). Despite being asynchronous, however, the order
# of execution of Promise objects in a chain (or tree) is strictly defined.
Expand Down
2 changes: 1 addition & 1 deletion lib/concurrent-ruby/concurrent/scheduled_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def initialize(delay, opts = {}, &task)
end
end

# The `delay` value given at instanciation.
# The `delay` value given at instantiation.
#
# @return [Float] the initial delay.
def initial_delay
Expand Down
2 changes: 1 addition & 1 deletion lib/concurrent-ruby/concurrent/synchronization/object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def self.new(*args, &block)

# Creates methods for reading and writing to a instance variable with
# volatile (Java) semantic as {.attr_volatile} does.
# The instance variable should be accessed oly through generated methods.
# The instance variable should be accessed only through generated methods.
# This method generates following methods: `value`, `value=(new_value) #=> new_value`,
# `swap_value(new_value) #=> old_value`,
# `compare_and_set_value(expected, value) #=> true || false`, `update_value(&block)`.
Expand Down
2 changes: 1 addition & 1 deletion lib/concurrent-ruby/concurrent/thread_safe/util/adder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module ThreadSafe
# @!visibility private
module Util

# A Ruby port of the Doug Lea's jsr166e.LondAdder class version 1.8
# A Ruby port of the Doug Lea's jsr166e.LongAdder class version 1.8
# available in public domain.
#
# Original source code available here:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module Util
# Usage:
# x = XorShiftRandom.get # uses Kernel.rand to generate an initial seed
# while true
# if (x = XorShiftRandom.xorshift).odd? # thread-localy generate a next random number
# if (x = XorShiftRandom.xorshift).odd? # thread-locally generate a next random number
# do_something_at_random
# end
# end
Expand Down
2 changes: 1 addition & 1 deletion spec/concurrent/actor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def on_message(message)
end

describe 'dead letter routing' do
it 'logs by deafault' do
it 'logs by default' do
ping = Ping.spawn! :ping, []
ping << :terminate!
ping << 'asd'
Expand Down
4 changes: 2 additions & 2 deletions spec/concurrent/async_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def many(*args, &block) nil; end
}.to raise_error(ArgumentError)
end

it 'raises an error when pasing too many arguments (arity >= 0)' do
it 'raises an error when passing too many arguments (arity >= 0)' do
expect {
subject.async.echo(1, 2, 3, 4, 5)
}.to raise_error(StandardError)
Expand Down Expand Up @@ -224,7 +224,7 @@ def many(*args, &block) nil; end
}.to raise_error(ArgumentError)
end

it 'raises an error when pasing too many arguments (arity >= 0)' do
it 'raises an error when passing too many arguments (arity >= 0)' do
expect {
subject.await.echo(1, 2, 3, 4, 5)
}.to raise_error(StandardError)
Expand Down
2 changes: 1 addition & 1 deletion spec/concurrent/executor/safe_task_executor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module Concurrent
expect(expected).to eq [1, 2, 3]
end

it 'protectes #execute with a mutex' do
it 'protects #execute with a mutex' do
expect(subject).to receive(:synchronize).with(no_args)
subject.execute
end
Expand Down
2 changes: 1 addition & 1 deletion spec/concurrent/executor/thread_pool_executor_shared.rb
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@
subject << proc { all_tasks_posted.wait; initial_executed.increment; }
end

# Inject 20 more tasks, which should throw an exeption
# Inject 20 more tasks, which should throw an exception
20.times do
expect {
subject << proc { subsequent_executed.increment; }
Expand Down
2 changes: 1 addition & 1 deletion spec/concurrent/processing_actor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def count(actor, count)
# continue running
count(actor, count)
when Integer
# this will call count again to set up what to do on next message, based on new state `count + numer`
# this will call count again to set up what to do on next message, based on new state `count + number`
count(actor, count + number_or_command)
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/concurrent/utility/processor_count_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ module Concurrent

RSpec.describe '#processor_count' do

it 'retuns a positive integer' do
it 'returns a positive integer' do
expect(Concurrent::processor_count).to be_a Integer
expect(Concurrent::processor_count).to be >= 1
end
end

RSpec.describe '#physical_processor_count' do

it 'retuns a positive integer' do
it 'returns a positive integer' do
expect(Concurrent::physical_processor_count).to be_a Integer
expect(Concurrent::physical_processor_count).to be >= 1
end
Expand Down
Loading