François · @francois
46 followers · 170 posts · Server ruby.social

Has anyone built a to assert that all event handlers are subscribed to the domain events they expect to receive? If not, I wrote something that might be extractable.

I found 5 event handlers out of 20 that expected some domain events but weren’t wired up properly!

#rubocop #railseventstore

Last updated 1 year ago

François · @francois
43 followers · 168 posts · Server ruby.social

PSA: Don't forget to restart your Rails web server (in development) if you edit `config/initializers/rails_event_store.rb`. I debugged this for an hour before realizing my mistake!

#railseventstore #ruby #rails

Last updated 1 year ago

François · @francois
43 followers · 167 posts · Server ruby.social

I wrote a event handler, and wrote specs for it. Unfortunately, I forgot to associate the event handler and the domain event in `config/intializers/rails_event_store.rb`.

Does anyone know of a Rubocop check that might have helped here?

I wrote a script, but it didn't detect that case. I think I'm almost ready to transform the script to a Rubocop check.

Thanks for any help!

#railseventstore

Last updated 1 year ago

François · @francois
40 followers · 137 posts · Server ruby.social

We're using and have a slight issue with event handlers ordering.

In a web process, we publish a ReportPublished. This triggers 3 separate enrichment jobs to be launched (Sidekiq). Each of these job publish events: ReportBlueEnrichmentCompleted, ReportRedEnrichmentCompleted and ReportGreenEnrichmentCompleted.

An event handler is subscribed to the Report*EnrichmentCompleted events. It must wait for the 3 events before proceeding (this is the scatter - gather pattern). 1/n

#railseventstore

Last updated 2 years ago

François · @francois
35 followers · 94 posts · Server ruby.social

We use . We have an Order model that has many Inspections. When inspections are scheduled, we publish an InspectionScheduled. Normally, we want to notify the customer that their inspection was scheduled, but there's a UI flag that allows us to skip notifications.

Right now, we added a boolean attribute on the InspectionScheduled domain event, but I feel like that attribute doesn't belong there.

1/n

#railseventstore

Last updated 2 years ago

François · @francois
35 followers · 80 posts · Server ruby.social

I'm looking for a way to speed up a projection. What I'd love to do is be able to specify preloads, otherwise, I will be running N+5N queries to fetch all the data I need. If I could do it in N+5, that'd be grand

The query API offered by rubydoc.info/gems/ruby_event_s will allow me to read events in batches, and from there I can run other queries to fetch the data I need, but the data won't all be linked together, as if read by ActiveRecord.

Do you have pointers or ideas?

#railseventstore

Last updated 2 years ago

François · @francois
28 followers · 61 posts · Server ruby.social

We found our first use-case for / projection at $DAYJOB: analytics.

We publish events regarding a certain process, and we want to derive metrics about the process. Since the events are already in the database, the projection allows us to go "back in time" and extract the metrics from the existing event stream.

In contrast, in a stateful system, the metrics would not be derivable for past objects, only for new changes happening in the system.

#rubyeventstore #railseventstore

Last updated 2 years ago

mostlyobvious · @mostlyobvious
42 followers · 10 posts · Server ruby.social

A discussion that could have been a blog post: github.com/RailsEventStore/rai

I'll be rewriting some docs next week and event schemas deserve a clearer guide

#railseventstore

Last updated 2 years ago

François · @francois
25 followers · 48 posts · Server ruby.social

I'm trying to mash up all kinds of things together at once:

2.0 RC1

from

All of these are *designed* to work together, but the going is rough.

My current status is this patch: github.com/francois/LetsMeet/p

The Hanami console boots, but I can't access the event store due to an `ArgumentError: missing keyword: :serializer`. Will sleep on it and see if I can get more progress tomorrow.

Yes, I am following the Hanami 2.0 guide to implement persistence

#hanami #rom #rubyeventstore #railseventstore

Last updated 2 years ago

mostlyobvious · @mostlyobvious
32 followers · 7 posts · Server ruby.social

Looking now at a quick shell with a disposable postgresql database running in it, reachable by unix socket only. Sounds too good to be true, yet it will significantly improve CI pipelines

#railseventstore

Last updated 2 years ago

mostlyobvious · @mostlyobvious
32 followers · 7 posts · Server ruby.social

This week I've been constantly reminding myself of fu, that I left unpracticed for years.

Back in the day I've contributed initial buildkite-agent.nix module. Today I'm using someone's else github-runner.nix 💚

In 2016 when we've invited Sander van der Burg to introduce to Ruby audience at , that all sounded exotic.

Today it feels maintsteam and one can play with on easily!

CI is going to have a nice boost with self-hosted workers soon!

#nix #Wrocloverb #macos #railseventstore

Last updated 2 years ago

François · @francois
20 followers · 41 posts · Server ruby.social

Hey all! I’m François, hailing from Quebec, Canada. I deployed my first Rails app back in 2005, on Rails 0.13.1. I’m currently interested in , , and generally anything about designing applications.

Other than programming, I’m also big fan of , a , and a dad.

Happy to be here!

#ddd #domainstorytelling #railseventstore #factorio #scout

Last updated 2 years ago