Skip to content

Commit

Permalink
Add better support for pub/sub messaging (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ostrzyciel authored Jan 9, 2023
1 parent 03284b7 commit 155b9ce
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
12 changes: 11 additions & 1 deletion grpc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,19 @@ import "rdf.proto";

// === Pub/Sub ===
message RdfStreamSubscribe {
// The topic to which the client wants to subscribe.
string topic = 1;
// Optional: the stream options requested by the client.
// The server should respond with a stream that matches these options.
// In case that is not possible, the server must respond with the
// INVALID_ARGUMENT error.
RdfStreamOptions requested_options = 2;
}

message RdfStreamReceived {
}

service RdfStreamService {
rpc StreamRdf (RdfStreamSubscribe) returns (stream RdfStreamFrame);
rpc SubscribeRdf (RdfStreamSubscribe) returns (stream RdfStreamFrame);
rpc PublishRdf (stream RdfStreamFrame) returns (RdfStreamReceived);
}
10 changes: 7 additions & 3 deletions rdf.proto
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,15 @@ message RdfDatatypeEntry {
}

message RdfStreamOptions {
RdfStreamType stream_type = 1;
// Name of the stream (completely optional).
// This may be used for, e.g., topic names in a pub/sub system.
string stream_name = 1;
// Type of the stream (required)
RdfStreamType stream_type = 2;
// Whether the stream may contain generalized triples, quads, or datasets
bool generalized_statements = 2;
bool generalized_statements = 3;
// Whether RdfRepeat will be used
bool use_repeat = 3;
bool use_repeat = 4;
// Prefix tables
uint32 max_name_table_size = 9;
uint32 max_prefix_table_size = 10;
Expand Down

0 comments on commit 155b9ce

Please sign in to comment.