hanami / events

[Experimental] Events framework for Hanami
MIT License
43 stars 7 forks source link

Add postgreSQL adapter #56

Closed davydovanton closed 6 years ago

russo-matrosso commented 6 years ago

Hi! I'm working on this issue now and found a problem. Postgress don't assume dots and especially patterns in its channel mechanism. So this library's feature and familiar naming like 'user.created' are not available. So the question is: is it OK to add a postgreSQL adapter with such limitations?

davydovanton commented 6 years ago

I think we can create new issue with custom separator :)

Something like:

event = Event.new(:memory, seporator: '_') # => will allow to use user_created event names

WDYT?

russo-matrosso commented 6 years ago

Well, I found a way to make naming like 'user.created' available. But still, no patterns :( https://github.com/hanami/events/pull/67

davydovanton commented 6 years ago

Hey, sorry but after discussion with @jodosha, we decide to make hanami-events as a pub/sub lib with simple memory and redis adapters only. That's why I should close this issue. I'm sorry for spending you time with it 😞

joelvh commented 6 years ago

hi @davydovanton I'm new to Hanami and very interested in this aspect of the framework. I use Wisper currently, and gathered that Hanami has removed Wisper in favor of a custom event API. Where is the best place to see the current status/roadmap/thoughts on this event-driven architecture for Hanami? Happy to contribute as well. Thanks!

davydovanton commented 6 years ago

hey, yep, we want to create pub/sup system without global state and with adapters (and ability to use custom adapters). I'm thinking about roadmap and I hope, I'll create it soon 👍

jodosha commented 6 years ago

Folks, what I'd love you to figure out is: how to make hanami-events capable to use third-party adapters like PG, or any other data store. Thanks in advance.

russo-matrosso commented 6 years ago

Well, I'll just make a separate PG adapter for hanami-events I think it would be OK. You'll have freedom to introduce new features, and if someone would like to use a bit cutted, but functionable adapter - that would be OK too.

joelvh commented 6 years ago

Curious what lead to move away from something simple like Wisper, where anyone can customize the implementation without Hanami having to be bogged down with building and maintaining those things? Thanks.

jodosha commented 6 years ago

@joelvh I'm not sure I understood the question. WDYM? Thanks 😄

joelvh commented 6 years ago

@jodosha I was just suggesting to introduce some pub/sub API and allow it to be configurable/modular so developers can worry about creating their own "backends". Wisper was great to have a light pub/sub out-of-the-box and you can use other extensions/plugins to integrate with Sidekiq or other things. I don't know the reasoning for Hanami to move away from Wisper, but rebuilding it and also having to maintain various types of backends seems like a lot of work to take on?

Just my 2 cents. New to Hanami and look forward to lending a hand.