You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
838 B
28 lines
838 B
package broker
|
|
|
|
import (
|
|
"context"
|
|
"github.com/seaweedfs/seaweedfs/weed/mq/topic"
|
|
"github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
|
|
)
|
|
|
|
func (b *MessageQueueBroker) ClosePublishers(ctx context.Context, request *mq_pb.ClosePublishersRequest) (resp *mq_pb.ClosePublishersResponse, err error) {
|
|
resp = &mq_pb.ClosePublishersResponse{}
|
|
|
|
t := topic.FromPbTopic(request.Topic)
|
|
|
|
b.localTopicManager.ClosePublishers(t, request.UnixTimeNs)
|
|
|
|
// wait until all publishers are closed
|
|
b.localTopicManager.WaitUntilNoPublishers(t)
|
|
|
|
return
|
|
}
|
|
|
|
func (b *MessageQueueBroker) CloseSubscribers(ctx context.Context, request *mq_pb.CloseSubscribersRequest) (resp *mq_pb.CloseSubscribersResponse, err error) {
|
|
resp = &mq_pb.CloseSubscribersResponse{}
|
|
|
|
b.localTopicManager.CloseSubscribers(topic.FromPbTopic(request.Topic), request.UnixTimeNs)
|
|
|
|
return
|
|
}
|