taoensso / telemere

Structured telemetry library for Clojure/Script
https://www.taoensso.com/telemere
Eclipse Public License 1.0
200 stars 5 forks source link

Idempotence #12

Closed olavfosse closed 5 months ago

olavfosse commented 5 months ago

I'm assuming fns like add-handler! are idempotent, but it would be nice to have it explicitly in the docs.

ptaoussanis commented 5 months ago

@olavfosse Hi Olav! Could you please share a little more about what your underlying concern is? Is there a particular reason you're concerned with idempotence here?

olavfosse commented 5 months ago

I want to make sure it's fine if I evaluate my source file several times.

olavfosse commented 5 months ago

I'm assuming it's fine since the handler is registered under an id.

ptaoussanis commented 5 months ago

I'm assuming it's fine since the handler is registered under an id.

Correct, there's no problem to re-eval your add-handler! calls. All add-handler! does is ensure that the given handler is registered under the given id.

Hope that helps!

olavfosse commented 5 months ago

Thanks!