fluo icon indicating copy to clipboard operation
fluo copied to clipboard

Test close methods in API

Open keith-turner opened this issue 11 years ago • 2 comments

Various parts of the API have close methods (FluoClient, Transaction, Snapshot, etc). Need to add ITs that exercise these inorder to define behaviour and prevent regressions. At least need to test calling close multiple times and using object after close is called.

keith-turner avatar Sep 16 '14 16:09 keith-turner

The question of whether or not close methods should be idempotent (can be called multiple times) came up in #190. @keith-turner and I came to the conclusion that user facing close methods in the API should be able to be called multiple times while close methods in implementation code should only be called once. A second call to close() is a sign that there may a bug. In implementation code, preconditions should be used to check if the close() is called multiple times and throw an exception.

mikewalch avatar Sep 18 '14 23:09 mikewalch

+1 I like this approach- I don't like forcing too much on a user and causing annoyances that could be avoided with a little smarter API.

cjnolet avatar Sep 19 '14 15:09 cjnolet