Generate event ID for each adapter
@davydovanton is already working on this.
Since Apr 22, 2018.
Assessment
This issue has not been assessed yet.
Description
We want to see simple way for debugging events, that's why we need to use sequences for each adapter type and generate event_id. For example:
events = Hanami::Events.initialize(:memory_sync)
events.subscribe('user.created') { |payload| p payload }
events.broadcast('user.created', user_id: 1) # => event_id
Backlog
- Generate simple UUID as a event id (eid) (https://github.com/hanami/events/pull/80)
- Use a
metakeyword in subscribe block for getting eid - Try to use universally Unique Lexicographically-sortable time-based Identifiers as eid (https://github.com/abachman/ulid-ruby)
Event type
I really love idea from redis streams:
The ID is composed of two parts: a millisecond time and a sequence number. 1506871964177 is the millisecond time, and is just a Unix time with millisecond resolution. The number after the dot, 0, is the sequence number, and is used in order to distinguish entries added in the same millisecond. Both numbers are 64 bit unsigned integers. This means that we can add all the entries we want in a stream, even in the same millisecond.
That's why, let's create event id as time.seq
- Dominant language
- Ruby
- Stars
- 41
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hanami/events
-
Abandoned?Open
Difficulty 5/5 Over a week Newbie friendliness 1/100
-
Difficulty 1/5 Under an hour Newbie friendliness 5/100
-
First-Class Support for Subscribers in Separate ProcessesMay be free again @davydovanton claimed this 3094 days ago, and no pull request is open. Openenhancement
-
Introduce typed event payloadMay be free again @davydovanton claimed this 3146 days ago, and no pull request is open. Openenhancement
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
hanami/hanami-action#536 ·
-
[2026-11] Latest release (2026-11) still has expanded list entries that are no longer supportedOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Shopify/product-taxonomy#1054 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 13 days
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
docker/model-runner#1118 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
TarteelAI/quranic-universal-library#1111 ·
Maintainers usually reply within 1 day