MySQL 8.0.39
Source Code Documentation
s_mysql_group_replication_message_service_recv Struct Reference

A service that gets called whenever an agnostic message from the group replication stream is to be delivered by the group replication receiver thread. More...

#include <group_replication_message_service.h>

Public Attributes

mysql_service_status_t(* recv )(const char *tag, const unsigned char *payload, const size_t payload_length)
 This function of every service implementation SHALL be called by group replication whenever the group replication receive a service message sent to the group. More...
 

Detailed Description

A service that gets called whenever an agnostic message from the group replication stream is to be delivered by the group replication receiver thread.

The implementation MUST NOT block the caller.

This only works if the component is on a server with group replication running and the member state is ONLINE. If server isn't ONLINE message won't be notified about messages received.

DEFINE_BOOL_METHOD(recv, (const char *tag, const unsigned char *data,
size_t data_length)) {
// If tag is of interest do something with data
return false;
}
group_replication_message_service_recv)
bool register_listener() {
SERVICE_TYPE(registry) *plugin_registry = mysql_plugin_registry_acquire();
my_service<SERVICE_TYPE(registry_registration)> reg("registry_registration",
plugin_registry);
using group_replication_message_service_recv_t =
SERVICE_TYPE_NO_CONST(group_replication_message_service_recv);
bool result = reg->register_service(
"group_replication_message_service_recv.listener_example",
reinterpret_cast<my_h_service>(
const_cast<group_replication_message_service_recv_t *>(
listener_example,
group_replication_message_service_recv))));
Wraps my_h_service struct conforming ABI into RAII C++ object with ability to cast to desired service...
Definition: my_service.h:35
struct my_h_service_imp * my_h_service
A handle type for acquired Service.
Definition: registry.h:33
#define SERVICE_TYPE(name)
Generates the standard Service type name.
Definition: service.h:76
#define SERVICE_TYPE_NO_CONST(name)
Generates the standard Service type name.
Definition: service.h:71
#define BEGIN_SERVICE_IMPLEMENTATION(component, service)
Declares a Service Implementation.
Definition: service_implementation.h:62
#define END_SERVICE_IMPLEMENTATION()
A macro to end the last declaration of a Service Implementation.
Definition: service_implementation.h:67
#define DEFINE_BOOL_METHOD(name, args)
A short macro to define method that returns bool, which is the most common case.
Definition: service_implementation.h:88
#define SERVICE_IMPLEMENTATION(component, service)
Reference to the name of the service implementation variable.
Definition: service_implementation.h:51
const mysql_service_registry_t * mysql_plugin_registry_acquire()
Returns a new reference to the "registry" service.
Definition: plugin_registry_service.cc:47
Definition: result.h:30
mysql_service_status_t(* recv)(const char *tag, const unsigned char *payload, const size_t payload_length)
This function of every service implementation SHALL be called by group replication whenever the group...
Definition: group_replication_message_service.h:123

Member Data Documentation

◆ recv

mysql_service_status_t(* s_mysql_group_replication_message_service_recv::recv) (const char *tag, const unsigned char *payload, const size_t payload_length)

This function of every service implementation SHALL be called by group replication whenever the group replication receive a service message sent to the group.

Parameters
[out]tagtag identifies message
[out]payloaddata to be deliver
[out]payload_lengthsize of data
Returns
false success, true on failure.

The documentation for this struct was generated from the following file: