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

Event source concept #62

Merged
merged 2 commits into from Oct 5, 2021
Merged

Event source concept #62

merged 2 commits into from Oct 5, 2021

Conversation

woksin
Copy link
Contributor

@woksin woksin commented Oct 4, 2021

Summary

Update to new contracts that changes partition and event source id to be a string instead of a guid. Fix all build errors that

Copy link
Contributor

@jakhog jakhog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have commented all the places where the Guid should come back if it needs to

@@ -193,7 +193,7 @@ export class EventStore extends IEventStore {
return new CommittedAggregateEvents(eventSourceId, aggregateRootId, ...convertedEvents);
}

private toUncommittedEvent(content: any, eventSourceId: EventSourceId | Guid | string, eventTypeOrId?: EventType | EventTypeId | Guid | string, isPublic = false): UncommittedEvent {
private toUncommittedEvent(content: any, eventSourceId: EventSourceId | string, eventTypeOrId?: EventType | EventTypeId | Guid | string, isPublic = false): UncommittedEvent {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's bring the Guid conversions back until we get the poll data :)

*/
fromProducerPartition(partitionId: PartitionId | Guid | string): SubscriptionBuilderForProducerPartition {
fromProducerPartition(partitionId: PartitionId | string): SubscriptionBuilderForProducerPartition {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guid here

@@ -13,9 +13,9 @@ export class PartitionedFilterResult {
/**
* Initializes a new instance of {@link PartitionedFilterResult}.
* @param {boolean} shouldInclude Tells whether or not the event should be included.
* @param {PartitionId | Guid | string} partitionId Tells which partition the event should be partitioned into.
* @param {PartitionId | string} partitionId Tells which partition the event should be partitioned into.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guid here

@@ -31,8 +31,8 @@ export class EventSourceId extends ConceptAs<Guid, '@dolittle/sdk.events.EventSo
* @param {EventSourceId | Guid | string)} id
* @returns {EventSourceId}
*/
static from(id: EventSourceId | Guid | string): EventSourceId {
static from(id: EventSourceId | string): EventSourceId {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guid here

Comment on lines +61 to +63
commit(event: any, eventSourceId: EventSourceId | string, eventType?: EventType | EventTypeId | Guid | string, cancellation?: Cancellation): Promise<CommitEventsResult>;
commit(eventOrEvents: UncommittedEvent | UncommittedEvent[], cancellation?: Cancellation): Promise<CommitEventsResult>;
commit(eventOrEvents: any, eventSourceIdOrCancellation?: EventSourceId | Guid | string | Cancellation, eventType?: EventType | EventTypeId | Guid | string, cancellation?: Cancellation): Promise<CommitEventsResult> {
commit(eventOrEvents: any, eventSourceIdOrCancellation?: EventSourceId | string | Cancellation, eventType?: EventType | EventTypeId | Guid | string, cancellation?: Cancellation): Promise<CommitEventsResult> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guid here

return this.commitInternal([this.toUncommittedEvent(eventOrEvents, eventSourceId, eventType, false)], cancellation);
}

/** @inheritdoc */
commitPublic(event: any, eventSourceId: EventSourceId | Guid | string, eventType?: EventType | EventTypeId | Guid | string, cancellation?: Cancellation): Promise<CommitEventsResult> {
commitPublic(event: any, eventSourceId: EventSourceId | string, eventType?: EventType | EventTypeId | Guid | string, cancellation?: Cancellation): Promise<CommitEventsResult> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guid here

Comment on lines +79 to +81
commitForAggregate(event: any, eventSourceId: EventSourceId | string, aggregateRootId: AggregateRootId, expectedAggregateRootVersion: AggregateRootVersion, eventType?: EventType | EventTypeId | Guid | string, cancellation?: Cancellation): Promise<CommitAggregateEventsResult>;
commitForAggregate(events: UncommittedAggregateEvents, cancellation?: Cancellation): Promise<CommitAggregateEventsResult>;
commitForAggregate(eventOrEvents: any, eventSourceIdOrCancellation?: EventSourceId | Guid | string | Cancellation, aggregateRootId?: AggregateRootId, expectedAggregateRootVersion?: AggregateRootVersion, eventType?: EventType | EventTypeId | Guid | string, cancellation?: Cancellation): Promise<CommitAggregateEventsResult> {
commitForAggregate(eventOrEvents: any, eventSourceIdOrCancellation?: EventSourceId | string | Cancellation, aggregateRootId?: AggregateRootId, expectedAggregateRootVersion?: AggregateRootVersion, eventType?: EventType | EventTypeId | Guid | string, cancellation?: Cancellation): Promise<CommitAggregateEventsResult> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guid here

@woksin
Copy link
Contributor Author

woksin commented Oct 5, 2021

Merging this in as I've said that I will fix the SDK that is in the wrong :)

@woksin woksin merged commit 06ac206 into 18.0.0-eventsource Oct 5, 2021
@woksin woksin deleted the event-source-concept branch October 5, 2021 08:11
jakhog added a commit that referenced this pull request Oct 13, 2021
…ing Contracts v6.0.0, and fix little Embedding bug (#61)

* Add eventsource prerelease branch

* Event source concept (#62)

* Update references to contracts

* Change partition and event source id to be string instead of guid and fix all build errors

* "Update packages and workspace dependencies to 18.0.0-eventsource.0"

* Revert Guid types for event source id and partition id (#63)

* "Update packages and workspace dependencies to 18.0.0-eventsource.1"

* Upgrade contracts to released 6.0.0 (#64)

* Upgrade to released 6.0.0 contracts

* Fix references to event types

* "Update packages and workspace dependencies to 18.0.0-eventsource.2"

* Fix a little non breaking space

* Fix some small typing issues.

* Fix bug when returning multiple events from an embedding update/delete.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jakob Høgenes <1014990+jakhog@users.noreply.github.com>
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

2 participants