]> Entropealabs - cluster_kv.git/commitdiff
update types for :not_found atom
authorChristopher <chris@entropealabs.com>
Wed, 25 Mar 2020 15:51:36 +0000 (10:51 -0500)
committerChristopher <chris@entropealabs.com>
Wed, 25 Mar 2020 15:51:36 +0000 (10:51 -0500)
lib/cluster_kv/db.ex
lib/cluster_kv/ring.ex

index 3e99b6a001d41f8ed5b7c7aa34747a3fcbbdf7a7..b0ead963995d26562958d01c00578c113484af81 100644 (file)
@@ -6,7 +6,7 @@ defmodule ClusterKV.DB do
 
   defstruct [:db, :batch_chunk, :batch_fun, :batch_ref, last_batch: 0, batch: []]
 
-  @type element :: {key :: String.t(), value :: any()}
+  @type element :: {key :: String.t(), value :: any()} | :not_found
 
   @type t :: %__MODULE__{
           db: :ets.tid() | atom(),
index 27ef1ef8fb81d482108253edcdf28d81300cb2f1..8b3cf276572f14d83604d221deb8bc3ef3b0362a 100644 (file)
@@ -104,7 +104,7 @@ defmodule ClusterKV.Ring do
           split_on :: String.t(),
           min :: integer(),
           timeout :: non_neg_integer() | :infinity
-        ) :: [DB.element()]
+        ) :: [DB.element()] | :not_found
   def prefix(name, keyspace, key, split_on, min, timeout) do
     :gen_statem.call(ClusterKV.ring_name(name), {:prefix, keyspace, key, split_on, min}, timeout)
   end
@@ -117,7 +117,7 @@ defmodule ClusterKV.Ring do
           join :: String.t(),
           wildcard :: String.t(),
           timeout :: non_neg_integer() | :infinity
-        ) :: [DB.element()]
+        ) :: [DB.element()] | :not_found
   def wildcard(name, keyspace, key, split_on, join, wildcard, timeout) do
     :gen_statem.call(
       ClusterKV.ring_name(name),