Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Andrea Leopardi <[email protected]>
  • Loading branch information
am-kantox and whatyouhide authored Jul 29, 2024
1 parent 1a3208f commit d8d3835
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/nimble_ownership.ex
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ defmodule NimbleOwnership do
If the process is not yet started at the moment of allowance definition, it might be allowed
as a function, assuming at the moment of invocation it would have been started.
If the function cannot be resolved to a pid during invocation, the expectation will not succeed.
If the function cannot be resolved to a PID during invocation, the expectation will not succeed.
The function might return a `t:pid/0` or a list of `t:pid/0`s, the latter might be helpful
if one needs to allow a pool of unnamed workers.
The function might return a `t:pid/0` or a list of `t:pid/0`s. A list might be helpful
if one needs to allow multiple PIDs that resolve from a single term, such as the list of workers in a pool.
## Examples
Expand All @@ -170,8 +170,8 @@ defmodule NimbleOwnership do
{:ok, self()}
"""
@spec allow(server(), pid(), pid() | (-> pid()) | (-> [pid()]), key()) ::
:ok | {:error, Error.t()}
@spec allow(server(), pid(), pid() | (-> resolved_pid)), key()) ::
:ok | {:error, Error.t()} when resolved_pid: pid() | [pids()]
def allow(ownership_server, pid_with_access, pid_to_allow, key, timeout \\ 5000)
when is_pid(pid_with_access) and (is_pid(pid_to_allow) or is_function(pid_to_allow, 0)) and
is_timeout(timeout) do
Expand Down

0 comments on commit d8d3835

Please sign in to comment.