rinq / rinq-go

A cross-language command bus and distributed ephemeral data store.
Other
17 stars 1 forks source link

Implement method for "clearing" all attributes in a specific namespace. #132

Closed jmalloc closed 7 years ago

jmalloc commented 7 years ago

This is a session operation that sets all attributes in a given namespace to the empty string. This is an "update-like" operation insofar as revision-based optimistic locking must be applied as it is for Update() or Destroy().

We will have to make a decision about how to handle frozen attributes, some options are:

My inclination is quite strongly towards (a), as it honours the existing semantics of Update().

/cc @ezzatron

jmalloc commented 7 years ago

Perhaps Revision.Clear(ctx, ns) as far as a method name.

ezzatron commented 7 years ago

If you go with (a) I can't see this being used a lot. The use case we had in mind was clearing authentication data for long-running websocket connections, which is a case where we'd probably always want to use frozen attributes for (at least) IP addresses.

It would be nice not to be forced into a trade-off.

jmalloc commented 7 years ago

In that particular case I would expect those IP addresses to be in a different namespace (rinq.httpd), as they are not auth related.

ezzatron commented 7 years ago

Yeah, I guess that works.