[MM-35077] Add basic support for plugin intra-cluster communication (#17495)

* Add basic support for plugin intra-cluster communication

* Some renaming for added clarity

* Allow sending cluster event to specific nodes

* Improve naming and documentation

* Improve logging
Этот коммит содержится в:
Claudio Costa
2021-04-28 19:59:32 +02:00
коммит произвёл GitHub
родитель 7dc1718c1d
Коммит 6af032d06a
15 изменённых файлов: 236 добавлений и 4 удалений

Просмотреть файл

@@ -35,6 +35,7 @@ const (
UserHasBeenCreatedID = 17
ReactionHasBeenAddedID = 18
ReactionHasBeenRemovedID = 19
OnPluginClusterEventID = 20
TotalHooksID = iota
)
@@ -209,4 +210,13 @@ type Hooks interface {
//
// Minimum server version: 5.30
ReactionHasBeenRemoved(c *Context, reaction *model.Reaction)
// OnPluginClusterEvent is invoked when an intra-cluster plugin event is received.
//
// This is used to allow communication between multiple instances of the same plugin
// that are running on separate nodes of the same High-Availability cluster.
// This hook receives events sent by a call to PublishPluginClusterEvent.
//
// Minimum server version: 5.36
OnPluginClusterEvent(c *Context, ev model.PluginClusterEvent)
}