Skip to content

Commit b40034e

Browse files
authored
Update type spec of ConnGRPC.Pool.get_channel/1 (#32)
* update spec * update changelog * bump version
1 parent 32ec1e7 commit b40034e

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog for ConnGRPC
22

33

4+
## v0.4.3
5+
6+
### Fix
7+
8+
- Add missing return value to `@spec` of `ConnGRPC.Pool.get_channel/1`
9+
410
## v0.4.2
511

612
### Fix

‎lib/conn_grpc/pool.ex‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ defmodule ConnGRPC.Pool do
115115
defmacro __using__(use_opts \\ []) do
116116
quote do
117117
@doc "Returns a gRPC channel from the pool"
118-
@spec get_channel() :: {:ok, GRPC.Channel.t()} | {:error, :not_connected}
118+
@spec get_channel() ::
119+
{:ok, GRPC.Channel.t()} | {:error, :not_connected} | {:error, :not_started}
119120
def get_channel, do: ConnGRPC.Pool.get_channel(__MODULE__)
120121

121122
@doc "Returns a gRPC channel from the pool, raising on error"
@@ -163,11 +164,11 @@ defmodule ConnGRPC.Pool do
163164
end
164165

165166
@doc "Returns a gRPC channel from the pool"
166-
@spec get_channel(module | atom) :: {:ok, GRPC.Channel.t()} | {:error, :not_connected}
167+
@spec get_channel(module | atom) ::
168+
{:ok, GRPC.Channel.t()} | {:error, :not_connected} | {:error, :not_started}
167169
def get_channel(pool_name) do
168-
start = System.monotonic_time()
169-
170170
if registry_alive?(pool_name) do
171+
start = System.monotonic_time()
171172
channels = Registry.lookup(registry(pool_name), :channels)
172173
pool_size = length(channels)
173174

‎mix.exs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ defmodule ConnGRPC.MixProject do
22
use Mix.Project
33

44
@source_url "https://github.com/TheRealReal/conn_grpc"
5-
@version "0.4.2"
5+
@version "0.4.3"
66

77
def project do
88
[

0 commit comments

Comments
 (0)