Nextdoor / ndserviceregistry

Nextdoor ServiceRegistry Foundational Python Class
27 stars 12 forks source link

Add non-Ephemeral data functionality #25

Closed diranged closed 10 years ago

diranged commented 10 years ago

Currently nd_service_registry.registration.Registration objects are 'greedy' - that is, they believe they own and need to continue to own the content at a given path. That means that if you create a data chunk at /services/myapp/config with supplied data {'foo': 'bar'}, for the duration that your ServiceRegistry object is alive, it will make sure that the configuration at that path looks like {'foo': 'bar'}. This means that if you use another ServiceRegistry object to change the data to {'foo': 'baZ'}, these two ServiceRegistry objects will now start to fight over which data is set at the path. This behavior is counter-intuitive.

What we likely need to do is create a nd_service_registry.registration.Data class that simply sets data at a given path, and nothing else. With this object, we likely need:

  1. A new set_data() method to easily set static data
  2. Updates to the unset() method to handle deleting static data
  3. CLI tools for handling these actions
diranged commented 10 years ago

Closed by Pull #33