Replies: 2 comments 2 replies
-
I would implement EmailService for this as separate thing, one exception that I see is when You want to push same events through websockets and email. Then You would have to send email from handler where You use websockets using same events queue, or just push event to EventService and to EmailService in place when event happens and then they will be using different queues. EmailService doesn't need queue because it's just sending emails. You don't have to receive this event in different part of program to pass it to the user. |
Beta Was this translation helpful? Give feedback.
-
I'm building an RSS reader following the philosophy defined in Ben's Standard Package Layout article. My project isn't ready yet, but it's opensource and called Doublequote. I didn't implement any WS stuff, but I do have an event queue. It works like this:
Let me know if you have any questions |
Beta Was this translation helpful? Give feedback.
-
Hey Ben!
I can see that the event notification approach is implementing the
EventService
interface, from what I understand you've implemented this interface withinmem.EventService
(correct me if i am wrong) and then use theSubscription
type to encapsulate each user under his own event receiver and subscription. Then you handle each subscription under the/events
route with*server.handleEvents
which pushes the events to the user through a ws connection. What would be the implementation of event handling but instead of pushing the event through a ws connection, I would like to notify the user through a provided email, which would be accessed through theuserID
.I hope that my question makes sense, if it doesn't I am happy to expand, I've been programming in go for 1 year and I am only 15 so I am not so experienced, but I am happy to learn! Also I understand if what I've said higher up is not correct or doesn't make sense so please correct me on my understanding of the program if otherwise. 😄
Kind Regards,
Patrick A
Beta Was this translation helpful? Give feedback.
All reactions