fun_with_flags icon indicating copy to clipboard operation
fun_with_flags copied to clipboard

Proposed Postgrex Changes

Open christianjgreen opened this issue 2 years ago • 6 comments

Hi there! First off thanks for maintaining such a useful library for the community.

I had been running fun_with_flags using a custom Postgrex adapter to handle notification updates. The goal was to make this code open sourced and wanted to know if you would prefer it as a PR fir this project or a separate optional Elixir lib. There are also some other popular pubsub systems that I've seen used in a similar manner. It would be great to get precedence from you on the direction these sorts of adapters should go as they grow.

christianjgreen avatar May 15 '22 20:05 christianjgreen

Hey there, thank you for using the library and for the suggestion.

Would this be a new dedicated notifications adapter? I'm open to the idea. If it implements the same API contract of the two existing ones, and it comes with tests, I think it would be a good addition.

I was also considering adding and documenting a Elixir Behaviour for the notifications adapters, like I've done for the persistence ones.

tompave avatar May 15 '22 22:05 tompave

Would this be a new dedicated notifications adapter?

It is! It has tests as well. It was written as a plug 'n' play adapter rather than a fork originally.

Would you prefer a new package along the lines of fwf_postgres_notifier, or as a PR as a new adapter?

christianjgreen avatar May 16 '22 00:05 christianjgreen

Either works for me. If it's a separate package and it works I guess that is fine too. I mean, if it's a separate package then my opinion doesn't really matter 😅.

tompave avatar May 16 '22 11:05 tompave

Ha I couldn't really make up my mind and ended up abusing your issue section for help on the decision. I know that some packages grow their "adapters" as separate libraries and some package them up in the same repo. Was hoping you had a preference for one, but if not I'll do a coin flip and see which has the least amount of cons. :)

Thanks again for the feedback

christianjgreen avatar May 16 '22 14:05 christianjgreen

Thank you for using the library and for extending its functionality! I'm glad that people find it useful!

tompave avatar May 16 '22 16:05 tompave

If you end up publishing your work as its own package, I would also welcome a PR to add a link to it in the readme here, in the notifications config section. :-)

tompave avatar May 16 '22 16:05 tompave