You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# create a bucketbucket="my_bucket"# connect{:ok,pid}=Gnat.start_link()# create a bucket{:ok,_info}=Gnat.Jetstream.API.KV.create_bucket(pid,bucket,history: 10)handler=fnaction,key,value->IO.puts("ACTION --> #{inspect(action)}")IO.puts("KEY --> #{inspect(key)}")IO.puts("VALUE --> #{inspect(value)}")end# start watching the bucket{:ok,_pid}=Gnat.Jetstream.API.KV.watch(pid,bucket,handler)# Put the first key:ok=Gnat.Jetstream.API.KV.create_key(pid,bucket,"my_key_1","my_value_1")# output:# ACTION --> :key_added# KEY --> "my_key_1"# VALUE --> "my_value_1"# delete the first key:ok=Gnat.Jetstream.API.KV.delete_key(pid,bucket,"my_key_1")# output:# ACTION --> :key_deleted# KEY --> "my_key_1"# VALUE --> ""# put the second key:ok=Gnat.Jetstream.API.KV.put_value(pid,bucket,"my_key_2","my_value_2")# output:# ACTION --> :key_added# KEY --> "my_key_2"# VALUE --> "my_value_2"# purge the second key:ok=Gnat.Jetstream.API.KV.purge_key(pid,bucket,"my_key_2")# actual output:# :ok## expected output:# ACTION --> :key_deleted# KEY --> "my_key_2"# VALUE --> ""
Expected Behavior
When a key is purged the watcher should emit the same message as if the key was deleted.
The text was updated successfully, but these errors were encountered:
Current Behavior
watching a bucket using Gnat.Jetstream.API.KV.watch/3 does not fire an event when a key is purged
Expected Behavior
When a key is purged the watcher should emit the same message as if the key was deleted.
The text was updated successfully, but these errors were encountered: