New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API for easily getting all historical events of certain kind (and/or other type of metadata) #72

Closed
paneq opened this Issue Jul 26, 2017 · 3 comments

Comments

2 participants
@paneq
Member

paneq commented Jul 26, 2017

without the need to use underlying ActiveRecord directly

event_ar = RailsEventStoreActiveRecord::Event.where(event_type: "MenuUpdated").find_each.select { |mu| mu.data["id"] == 72 }.last
event = RailsEventStoreActiveRecord::EventRepository.new.send(:build_event_entity, event_ar)
Catalog::MenuCatalogHandler.new.(event)

@paneq paneq added the enhancement label Jul 26, 2017

@mlomnicki

This comment has been minimized.

Show comment
Hide comment
@mlomnicki

mlomnicki Sep 1, 2017

Member

Idea: do it the GES way. They have a special stream $et-{EVENT_TYPE}. Thanks to that it's not necessary to introduce another API.

event = res.read_stream_forward("$et-MenuUpdated").select { |e| e.data["id"] == 72 }.last
Catalog::MenuCatalogHandler.new.(event)
Member

mlomnicki commented Sep 1, 2017

Idea: do it the GES way. They have a special stream $et-{EVENT_TYPE}. Thanks to that it's not necessary to introduce another API.

event = res.read_stream_forward("$et-MenuUpdated").select { |e| e.data["id"] == 72 }.last
Catalog::MenuCatalogHandler.new.(event)

@paneq paneq changed the title from Add API for easily getting all historical events of certain kind to Add API for easily getting all historical events of certain kind (and/or other type of metadata) Apr 3, 2018

@paneq

This comment has been minimized.

Show comment
Hide comment
@paneq

paneq Apr 3, 2018

Member

Related: #134 #177

Member

paneq commented Apr 3, 2018

Related: #134 #177

@paneq paneq referenced this issue Apr 3, 2018

Merged

WIP: Protobuf v2 #255

@paneq

This comment has been minimized.

Show comment
Hide comment
@paneq

paneq Jun 29, 2018

Member

Generally that's around 10 lines of code:

  • similar feature #382
Member

paneq commented Jun 29, 2018

Generally that's around 10 lines of code:

  • similar feature #382

@paneq paneq self-assigned this Jul 2, 2018

@paneq paneq added this to the v0.31 milestone Jul 2, 2018

paneq added a commit that referenced this issue Jul 2, 2018

paneq added a commit that referenced this issue Jul 2, 2018

@paneq paneq closed this Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment