-
Notifications
You must be signed in to change notification settings - Fork 0
proto: support queue #9
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
Open
ImeevMA
wants to merge
1
commit into
master
Choose a base branch
from
imeevma/gh-488-execute-push-field
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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
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,97 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| import "aeon_error.proto"; | ||
| import "aeon_value.proto"; | ||
|
|
||
| package aeon; | ||
|
|
||
| // Queue API to Aeon - a distributed database based on Tarantool. | ||
| service QueueService { | ||
| // Takes messages from a shard-local queue. | ||
| rpc TakeMessages(TakeMessagesRequest) returns (TakeMessagesResponse) {} | ||
|
|
||
| // Releases messages. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens if they aren't released? |
||
| rpc ReleaseMessages(ReleaseMessagesRequest) | ||
| returns (ReleaseMessagesResponse) {} | ||
|
|
||
| // Returns the oldest message for all storages, or the oldest message | ||
| // for each storage. | ||
| rpc GetOldestMessages(GetOldestMessagesRequest) | ||
| returns (GetOldestMessagesResponse) {} | ||
| } | ||
|
|
||
| // Description of returned messages. | ||
| message Message { | ||
| // Shard name. | ||
| string shard = 1; | ||
| // The serial number of the message on the shard. | ||
| uint64 lsn = 2; | ||
| // Data of the message. | ||
| Value data = 3; | ||
| } | ||
|
|
||
| // Consumer description. | ||
| message ConsumerRef { | ||
| // Consumer shard. | ||
| string shard = 1; | ||
| // Consumer topic. | ||
| string topic = 2; | ||
| // Consumer name. | ||
| string consumer = 3; | ||
| } | ||
|
|
||
| message TakeMessagesRequest { | ||
| // Topic name. | ||
| string topic = 1; | ||
| // Unique consumer name. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's it used for? |
||
| string consumer = 2; | ||
| // Max number of returned messages. | ||
| uint64 limit = 3; | ||
| // Time for the consumer to process the messages. | ||
| double ttl = 4; | ||
| // Exclusive mode flag. | ||
| bool exclusive = 5; | ||
| // Time to wait for messages. | ||
| double timeout = 6; | ||
| } | ||
|
|
||
| message TakeMessagesResponse { | ||
| // Error information. Set only on failure. | ||
| Error error = 1; | ||
| // Returned messages. | ||
| repeated Message messages = 2; | ||
| // Consumer reference used to release messages. | ||
| ConsumerRef ref = 3; | ||
| // True if these messages have already been taken by the same consumer, | ||
| // false otherwise. | ||
| bool taken_earlier = 4; | ||
| } | ||
|
|
||
| message ReleaseMessagesRequest { | ||
| // Consumer reference. | ||
| ConsumerRef ref = 1; | ||
| // If true, released messages will no longer be returned to consumers. | ||
| bool done = 2; | ||
| } | ||
|
|
||
| message ReleaseMessagesResponse { | ||
| // Error information. Set only on failure. | ||
| Error error = 1; | ||
| // True if messages were already released, false otherwise. | ||
| bool released_earlier = 2; | ||
| } | ||
|
|
||
| message GetOldestMessagesRequest { | ||
| // Topic name. | ||
| string topic = 1; | ||
| // True if the oldest messages for each shard should be returned, | ||
| // false if the oldest messages for all shards should be returned. | ||
| bool for_each_shard = 2; | ||
| } | ||
|
|
||
| message GetOldestMessagesResponse { | ||
| // Error information. Set only on failure. | ||
| Error error = 1; | ||
| // Returned messages. | ||
| repeated Message messages = 2; | ||
| } | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What arguments does this function take? In what language is it written? What is it supposed to return? Please write comments so that a user who isn't familiar with the implementation can figure out how to use this API.