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

Add service for embeddings #49

Merged
merged 2 commits into from
Apr 13, 2021
Merged

Add service for embeddings #49

merged 2 commits into from
Apr 13, 2021

Conversation

jakhog
Copy link
Contributor

@jakhog jakhog commented Apr 13, 2021

Summary

Added an embeddings service, that has three endpoints:

Connect, for registering an embedding:

An embedding is an extension of a projection (only allowed on the default scope), that also handles compare requests.
When the external state of an embedding changes, the embedding will be called to compare the externally provided state and the current state of the projection that has the same key. The method is expected to return a set of events that move the projection state closer to the external state. These events are committed and used to update the projection. This process will be repeated until the external and projection states are equal.

Update, for asking the runtime to start an update process:

At any time, the runtime can be called with a state for a given embedding id and key. If the state is not equal to the current state, the process described above will kick in. When the states are equal, the runtime will reply with the projected state. If it is not possible to reach the provided state for the specified embedding, the runtime will reply with a failure and not commit any events.

Delete, for asking the runtime to start an update process that results in a deletion:

This endpoint triggers the same behaviour as the Update endpoint, but where the desired state is that the given embedding id and key should not exist.

Note: for getting the current state of embeddings, the projections endpoint can be used with the embedding id as the state of embeddings are stored using projections.

Added

  • Service for registering an embedding, and for updating and deleting the state

@jakhog jakhog requested a review from joelhoisko April 13, 2021 09:11
@joelhoisko joelhoisko merged commit 0327c04 into 5.4.0-embeddings Apr 13, 2021
@joelhoisko joelhoisko deleted the add-embeddings branch April 13, 2021 10:46
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.

2 participants