Skip to content

docs: update promises grammar #1026

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 2 commits into from
Jan 15, 2024
Merged
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
34 changes: 17 additions & 17 deletions lib/concurrent-ruby/concurrent/promises.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def resolvable_event
resolvable_event_on default_executor
end

# Created resolvable event, user is responsible for resolving the event once by
# {Promises::ResolvableEvent#resolve}.
# Creates a resolvable event, user is responsible for resolving the event once
# by calling {Promises::ResolvableEvent#resolve}.
#
# @!macro promises.param.default_executor
# @return [ResolvableEvent]
Expand Down Expand Up @@ -95,7 +95,7 @@ def future(*args, &task)
future_on(default_executor, *args, &task)
end

# Constructs new Future which will be resolved after block is evaluated on default executor.
# Constructs a new Future which will be resolved after block is evaluated on default executor.
# Evaluation begins immediately.
#
# @!macro promises.param.default_executor
Expand All @@ -107,7 +107,7 @@ def future_on(default_executor, *args, &task)
ImmediateEventPromise.new(default_executor).future.then(*args, &task)
end

# Creates resolved future with will be either fulfilled with the given value or rejection with
# Creates a resolved future with will be either fulfilled with the given value or rejected with
# the given reason.
#
# @param [true, false] fulfilled
Expand All @@ -119,7 +119,7 @@ def resolved_future(fulfilled, value, reason, default_executor = self.default_ex
ImmediateFuturePromise.new(default_executor, fulfilled, value, reason).future
end

# Creates resolved future with will be fulfilled with the given value.
# Creates a resolved future which will be fulfilled with the given value.
#
# @!macro promises.param.default_executor
# @param [Object] value
Expand All @@ -128,7 +128,7 @@ def fulfilled_future(value, default_executor = self.default_executor)
resolved_future true, value, nil, default_executor
end

# Creates resolved future with will be rejected with the given reason.
# Creates a resolved future which will be rejected with the given reason.
#
# @!macro promises.param.default_executor
# @param [Object] reason
Expand Down Expand Up @@ -191,7 +191,7 @@ def delay(*args, &task)
delay_on default_executor, *args, &task
end

# Creates new event or future which is resolved only after it is touched,
# Creates a new event or future which is resolved only after it is touched,
# see {Concurrent::AbstractEventFuture#touch}.
#
# @!macro promises.param.default_executor
Expand All @@ -215,7 +215,7 @@ def schedule(intended_time, *args, &task)
schedule_on default_executor, intended_time, *args, &task
end

# Creates new event or future which is resolved in intended_time.
# Creates a new event or future which is resolved in intended_time.
#
# @!macro promises.param.default_executor
# @!macro promises.param.intended_time
Expand All @@ -241,8 +241,8 @@ def zip_futures(*futures_and_or_events)
zip_futures_on default_executor, *futures_and_or_events
end

# Creates new future which is resolved after all futures_and_or_events are resolved.
# Its value is array of zipped future values. Its reason is array of reasons for rejection.
# Creates a new future which is resolved after all futures_and_or_events are resolved.
# Its value is an array of zipped future values. Its reason is an array of reasons for rejection.
# If there is an error it rejects.
# @!macro promises.event-conversion
# If event is supplied, which does not have value and can be only resolved, it's
Expand All @@ -263,7 +263,7 @@ def zip_events(*futures_and_or_events)
zip_events_on default_executor, *futures_and_or_events
end

# Creates new event which is resolved after all futures_and_or_events are resolved.
# Creates a new event which is resolved after all futures_and_or_events are resolved.
# (Future is resolved when fulfilled or rejected.)
#
# @!macro promises.param.default_executor
Expand All @@ -281,8 +281,8 @@ def any_resolved_future(*futures_and_or_events)

alias_method :any, :any_resolved_future

# Creates new future which is resolved after first futures_and_or_events is resolved.
# Its result equals result of the first resolved future.
# Creates a new future which is resolved after the first futures_and_or_events is resolved.
# Its result equals the result of the first resolved future.
# @!macro promises.any-touch
# If resolved it does not propagate {Concurrent::AbstractEventFuture#touch}, leaving delayed
# futures un-executed if they are not required any more.
Expand All @@ -301,9 +301,9 @@ def any_fulfilled_future(*futures_and_or_events)
any_fulfilled_future_on default_executor, *futures_and_or_events
end

# Creates new future which is resolved after first of futures_and_or_events is fulfilled.
# Its result equals result of the first resolved future or if all futures_and_or_events reject,
# it has reason of the last resolved future.
# Creates a new future which is resolved after the first futures_and_or_events is fulfilled.
# Its result equals the result of the first resolved future or if all futures_and_or_events reject,
# it has reason of the last rejected future.
# @!macro promises.any-touch
# @!macro promises.event-conversion
#
Expand All @@ -320,7 +320,7 @@ def any_event(*futures_and_or_events)
any_event_on default_executor, *futures_and_or_events
end

# Creates new event which becomes resolved after first of the futures_and_or_events resolves.
# Creates a new event which becomes resolved after the first futures_and_or_events resolves.
# @!macro promises.any-touch
#
# @!macro promises.param.default_executor
Expand Down