Skip to content
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

feat(core): add support for flush events #642

Merged
merged 1 commit into from Jul 6, 2020
Merged

feat(core): add support for flush events #642

merged 1 commit into from Jul 6, 2020

Conversation

B4nan
Copy link
Member

@B4nan B4nan commented Jul 6, 2020

There is a special kind of events executed during the commit phase (flush operation).
They are executed before, during and after the flush, and they are not bound to any
entity in particular.

  • beforeFlush is executed before change sets are computed, this is the only
    event where it is safe to persist new entities.
  • onFlush is executed after the change sets are computed.
  • afterFlush is executed as the last step just before the flush call resolves.
    it will be executed even if there are no changes to be flushed.

Flush event args will not contain any entity instance, as they are entity agnostic.
They do contain additional reference to the UnitOfWork instance.

Closes #637

There is a special kind of events executed during the commit phase (flush operation).
They are executed before, during and after the flush, and they are not bound to any
entity in particular.

- `beforeFlush` is executed before change sets are computed, this is the only
  event where it is safe to persist new entities.
- `onFlush` is executed after the change sets are computed.
- `afterFlush` is executed as the last step just before the `flush` call resolves.
  it will be executed even if there are no changes to be flushed.

Flush event args will not contain any entity instance, as they are entity agnostic.
They do contain additional reference to the `UnitOfWork` instance.

Closes #637
@B4nan B4nan mentioned this pull request Jul 6, 2020
46 tasks
@B4nan B4nan merged commit d2b0219 into dev Jul 6, 2020
@B4nan B4nan deleted the flush-events branch July 6, 2020 21:21
B4nan added a commit that referenced this pull request Aug 2, 2020
There is a special kind of events executed during the commit phase (flush operation).
They are executed before, during and after the flush, and they are not bound to any
entity in particular.

- `beforeFlush` is executed before change sets are computed, this is the only
  event where it is safe to persist new entities.
- `onFlush` is executed after the change sets are computed.
- `afterFlush` is executed as the last step just before the `flush` call resolves.
  it will be executed even if there are no changes to be flushed.

Flush event args will not contain any entity instance, as they are entity agnostic.
They do contain additional reference to the `UnitOfWork` instance.

Closes #637
B4nan added a commit that referenced this pull request Aug 9, 2020
There is a special kind of events executed during the commit phase (flush operation).
They are executed before, during and after the flush, and they are not bound to any
entity in particular.

- `beforeFlush` is executed before change sets are computed, this is the only
  event where it is safe to persist new entities.
- `onFlush` is executed after the change sets are computed.
- `afterFlush` is executed as the last step just before the `flush` call resolves.
  it will be executed even if there are no changes to be flushed.

Flush event args will not contain any entity instance, as they are entity agnostic.
They do contain additional reference to the `UnitOfWork` instance.

Closes #637
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant