MySQL 9.0.0
Source Code Documentation
message_service.h
Go to the documentation of this file.
1/* Copyright (c) 2019, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef MESSAGE_SERVICE_H
25#define MESSAGE_SERVICE_H
26
30
31/**
32 Register default send message service.
33*/
35
36/**
37 Unregister default send message service.
38*/
40
41/**
42 @class Message_service_handler
43 Handles the deliver of recv service messages to subscribed modules.
44*/
46 public:
47 /**
48 Create a message service handler to deliver messages to recv subscribers.
49 */
51
53
54 /**
55 Initialize thread that will deliver messages.
56
57 @return returns 0 if succeeds, error otherwise
58 */
59 int initialize();
60
61 /**
62 Main loop that checks message availability.
63 */
64 void dispatcher();
65
66 /**
67 Terminate delivering message thread.
68
69 @return returns 0 if succeeds, error otherwise
70 */
71 int terminate();
72
73 /**
74 Add to queue a new message to be deliver to recv service subscribers.
75
76 @param[in] message message to be delivered
77 */
78 void add(Group_service_message *message);
79
80 /**
81 It will notify recv subscribers with a service message.
82
83 @param[in] service_message message to process
84
85 @return false if message is delivered, true otherwise
86 */
88
89 private:
90 /** Thread was terminated */
92 /** The current phase */
94 /** The thread lock to control access */
96 /** The thread signal mechanism to be terminated */
98 /** The state of the thread. */
100 /** Queue with service message to be delivered */
102};
103
104#endif /* MESSAGE_SERVICE_H */
Abortable synchronized queue extends synchronized queue allowing to abort methods waiting for element...
Definition: plugin_utils.h:272
Definition: group_service_message.h:34
Handles the deliver of recv service messages to subscribed modules.
Definition: message_service.h:45
bool m_aborted
Thread was terminated.
Definition: message_service.h:91
thread_state m_message_service_thd_state
The state of the thread.
Definition: message_service.h:99
mysql_cond_t m_message_service_run_cond
The thread signal mechanism to be terminated.
Definition: message_service.h:97
bool notify_message_service_recv(Group_service_message *service_message)
It will notify recv subscribers with a service message.
Definition: message_service.cc:273
Abortable_synchronized_queue< Group_service_message * > * m_incoming
Queue with service message to be delivered.
Definition: message_service.h:101
void dispatcher()
Main loop that checks message availability.
Definition: message_service.cc:149
int terminate()
Terminate delivering message thread.
Definition: message_service.cc:237
Message_service_handler()
Create a message service handler to deliver messages to recv subscribers.
Definition: message_service.cc:89
mysql_mutex_t m_message_service_run_lock
The thread lock to control access.
Definition: message_service.h:95
my_thread_handle m_message_service_pthd
The current phase.
Definition: message_service.h:93
int initialize()
Initialize thread that will deliver messages.
Definition: message_service.cc:119
void add(Group_service_message *message)
Add to queue a new message to be deliver to recv service subscribers.
Definition: message_service.cc:256
virtual ~Message_service_handler()
Definition: message_service.cc:99
bool unregister_gr_message_service_send()
Unregister default send message service.
Definition: message_service.cc:74
bool register_gr_message_service_send()
Register default send message service.
Definition: message_service.cc:57
Specifies macros to define Service Implementations.
Definition: my_thread_bits.h:58
An instrumented cond structure.
Definition: mysql_cond_bits.h:50
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50
Definition: plugin_utils.h:48