-
Notifications
You must be signed in to change notification settings - Fork 1
Feat/ add possibility to pass your own database driver to transactional event emitter #1
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
Merged
axotion
merged 5 commits into
main
from
feat/add-possibility-to-pass-database-drive-to-transactional-event-emitter
Feb 19, 2025
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
cbe15b1
feat implemented
Patryk1406 52a9e72
implemented
Patryk1406 4d8eb32
Merge pull request #2 from Nestixis/feat/make-inbox-outbox-event-name…
axotion 007678d
feat: refactor DatabaseDriver to extend DatabaseDriverPersister and u…
axotion 7da915a
fix: use nullish coalescing operator for persister assignment in Tran…
axotion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export interface DatabaseDriverPersister { | ||
|
||
persist<T>(entity: T): void; | ||
|
||
remove<T>(entity: T): void; | ||
|
||
flush(): Promise<void>; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,7 @@ | ||
import { InboxOutboxTransportEvent } from '../model/inbox-outbox-transport-event.interface'; | ||
import { DatabaseDriverPersister } from './database.driver-persister'; | ||
|
||
|
||
export interface DatabaseDriver { | ||
export interface DatabaseDriver extends DatabaseDriverPersister { | ||
createInboxOutboxTransportEvent(eventName: string, eventPayload: any, expireAt: number, readyToRetryAfter: number | null): InboxOutboxTransportEvent; | ||
|
||
findAndExtendReadyToRetryEvents(limit: number): Promise<InboxOutboxTransportEvent[]>; | ||
|
||
persist<T>(entity: T): Promise<void>; | ||
|
||
remove<T>(entity: T): Promise<void>; | ||
|
||
flush(): Promise<void>; | ||
} |
4 changes: 2 additions & 2 deletions
4
packages/core/src/emitter/contract/inbox-outbox-event.interface.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export abstract class InboxOutboxEvent { | ||
/** | ||
* @description Should be unique static name of the event | ||
* @description Should be unique name of the event | ||
*/ | ||
name: string; | ||
public abstract readonly name: string; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.