Skip to content

Commit

Permalink
Merge pull request #115 from nats-io/add_subscription_close
Browse files Browse the repository at this point in the history
[ADDED] Subscription.Close() allows closing durable
  • Loading branch information
kozlovic committed Nov 14, 2016
2 parents 76fd755 + 0d48ba8 commit c39373c
Show file tree
Hide file tree
Showing 5 changed files with 519 additions and 40 deletions.
260 changes: 254 additions & 6 deletions pb/protocol.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 17 additions & 5 deletions pb/protocol.proto
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ message ConnectRequest {

// Response to a client connect
message ConnectResponse {
string pubPrefix = 1; // Prefix to use when publishing to this STAN cluster
string subRequests = 2; // Subject to use for subscription requests
string unsubRequests = 3; // Subject to use for unsubscribe requests
string closeRequests = 4; // Subject for closing the stan connection
string error = 5; // err string, empty/omitted if no error
string pubPrefix = 1; // Prefix to use when publishing to this STAN cluster
string subRequests = 2; // Subject to use for subscription requests
string unsubRequests = 3; // Subject to use for unsubscribe requests
string closeRequests = 4; // Subject for closing the stan connection
string error = 5; // err string, empty/omitted if no error
string subCloseRequests = 6; // Subject to use for subscription close requests

string publicKey = 100; // Possibly used to sign acks, etc.
}
Expand Down Expand Up @@ -103,6 +104,17 @@ message UnsubscribeRequest {
string durableName = 4; // Optional durable name which survives client restarts
}

// Protocol for a client to close a subscription without unsubscribing.
// For non-durables, this would be equivalent to UnsubscribeRequest,
// however, for durables, this allow the server to remove the subscriber
// but keep the durable interest.
// Will return a SubscriptionResponse
message SubscriptionCloseRequest {
string clientID = 1; // ClientID
string subject = 2; // Subject for the subscription
string inbox = 3; // Inbox subject to identify the subscription
}

// Protocol for a client to close a connection
message CloseRequest {
string clientID = 1; // Client name provided to Connect() requests
Expand Down
Loading

0 comments on commit c39373c

Please sign in to comment.