ashwinraghav / mynotify

1 stars 1 forks source link

Garbage collection of Subscriptions and Exchanges. #14

Closed ashwinraghav closed 11 years ago

ashwinraghav commented 11 years ago

When there are no clients subscribing to a file anymore, these subscriptions need to be unsubscribed.

This may doing one of the two things:

1) Maintaining state on how many clients subscribe to a file. Every time a client unsubscribes, it needs to inform the server that it is going away. It becomes hard to tolerate network partitions.

2) Periodically just polling all exchanges to check if there are subscribers. If there are none, then delete the exchange and also the subscription. This is stateless at the server. But uses the state at the exchanges to accomplish the task. Feels more robust.