summaryrefslogtreecommitdiff
path: root/common/pubsub/interface.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-09-16 21:46:50 +0300
committerGitHub <[email protected]>2021-09-16 21:46:50 +0300
commit3581b45f237a3f7aa29591ceb2bf6f4a4642a2f5 (patch)
treee723b19ec1ac16b7ccc7b3c2da69d4a416d63d81 /common/pubsub/interface.go
parent337d292dd2d6ff0a555098b1970d8194d8df8bc2 (diff)
parent823d831b57b75f70c7c3bbbee355f2016633bb3b (diff)
[#803]: feat(plugins): move plugins to a separate repositoryv2.5.0-alpha.2
[#803]: feat(plugins): move plugins to a separate repository
Diffstat (limited to 'common/pubsub/interface.go')
-rw-r--r--common/pubsub/interface.go56
1 files changed, 0 insertions, 56 deletions
diff --git a/common/pubsub/interface.go b/common/pubsub/interface.go
deleted file mode 100644
index 5b69d577..00000000
--- a/common/pubsub/interface.go
+++ /dev/null
@@ -1,56 +0,0 @@
-package pubsub
-
-import "context"
-
-/*
-This interface is in BETA. It might be changed.
-*/
-
-// PubSub interface designed to implement on any storage type to provide pub-sub abilities
-// Publisher used to receive messages from the PHP app via RPC
-// Subscriber should be implemented to subscribe to a topics and provide a connections list per topic
-// Reader return next message from the channel
-type PubSub interface {
- Publisher
- Subscriber
- Reader
-}
-
-type SubReader interface {
- Subscriber
- Reader
-}
-
-// Subscriber defines the ability to operate as message passing broker.
-// BETA interface
-type Subscriber interface {
- // Subscribe broker to one or multiple topics.
- Subscribe(connectionID string, topics ...string) error
-
- // Unsubscribe from one or multiply topics
- Unsubscribe(connectionID string, topics ...string) error
-
- // Connections returns all connections associated with the particular topic
- Connections(topic string, ret map[string]struct{})
-}
-
-// Publisher publish one or more messages
-// BETA interface
-type Publisher interface {
- // Publish one or multiple Channel.
- Publish(message *Message) error
-
- // PublishAsync publish message and return immediately
- // If error occurred it will be printed into the logger
- PublishAsync(message *Message)
-}
-
-// Reader interface should return next message
-type Reader interface {
- Next(ctx context.Context) (*Message, error)
-}
-
-// Constructor is a special pub-sub interface made to return a constructed PubSub type
-type Constructor interface {
- PSConstruct(key string) (PubSub, error)
-}