Dan, with your approval, I’d like to add this to the documentation.
On Tue, 14 Jan 2020 at 11:27 am, Dan Mick <dmick(a)redhat.com> wrote:
On 1/12/20 5:48 AM, rima.khoury(a)nokia.com wrote:
according to the ceph documentation, when implementing a new ceph plugin
three functions that are important to override:
as shown in the documentation:
The most important methods to override are:
a serve member function for server-type modules. This function should
a notify member function if your module needs to take action when new
a handle_command member function if your module exposes CLI commands.
It is not very clear to me what is the difference between the serve
method and the
handle_command. when do I use one or another? can someone
please explain this a little further
handle_command must return, with specific return values, once the
command is handled (this might be used to return information to the
user, for example).
serve runs for whole time the module runs, and should block when it has
no work to do, just like a normal "service". It might wake up for
notifications delivered via notify(), for example, or perhaps periodically.
Not every module needs both serve() and handle_command(); it depends on
what you're trying to accomplish. Look at the existing modules to get
an idea of what both functions do and what they must pay attention to,
Dev mailing list -- dev(a)ceph.io
To unsubscribe send an email to dev-leave(a)ceph.io