QUORU...SPATCH(3)

πŸ’– quorum_dispatch β€” dispatches callbacks from the quorum service πŸ’–

okay bestie, welcome to the quorum_dispatch(3) page from the Corosync Cluster Engine Programmer's Manual. yes it's section 3, yes it's a library call, yes we're gonna have fun with it. sit down, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

quorum_dispatch β€” Dispatches callbacks from the quorum service


πŸŽ€ SYNOPSIS πŸŽ€

#include <corosync/quorum.h>

int quorum_dispatch(quorum_handle_t handle, cs_dispatch_flags_t
*dispatch_types);

like, that's the whole entrance. two args, one include, one dream πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so quorum_dispatch is the function you call when you want to dispatch configuration changes. that's the whole job. it's giving "i'm the event loop for your quorum vibes" energy.

here's the tea: each application can have several connections to the quorum API. you tell them apart with the handle argument β€” that's the thing that uniquely identifies which connection you're talking about. no handle, no idea which connection you mean. it's the name tag at the party πŸŽ€

then there's dispatch_types, and that's the one that decides what kind of dispatch you're doing. the possible types are defined by this structure, and i need you to look at it very carefully because the numbers matter:

typedef enum {
        CS_DISPATCH_ONE = 1,
        CS_DISPATCH_ALL = 2,
        CS_DISPATCH_BLOCKING = 3,
        CS_DISPATCH_ONE_NONBLOCKING = 4
} cs_dispatch_flags_t;

periodt. now the dispatch values, one by one, with meanings, because this is the part that actually matters:

  • CS_DISPATCH_ONE β€” dispatches at least one callback, and it blocks until that callback is dispatched. so you're waiting, but you're getting something out of it. at least one, minimum. it's a low bar but it's a bar ✨
  • CS_DISPATCH_ALL β€” dispatches all waiting callbacks, and it does not block waiting for any callbacks. everything that's already queued up? handled. nothing new? you're not sitting around waiting for it, bestie πŸ’…
  • CS_DISPATCH_BLOCKING β€” dispatches all callbacks, blocking indefinitely. and here's where it's used: in a threaded program where a thread is created, and then quorum_dispatch() is called immediately from the created thread to execute callbacks. that's the pattern. that's the whole vibe. forever-and-ever blocking, no cap 🫢
  • CS_DISPATCH_ONE_NONBLOCKING β€” dispatches at most one callback. and if there's no pending callback, CS_ERR_TRY_AGAIN is returned. so it never just... sits there. it either gives you a callback or it gives you that error. main character energy: never waits around πŸ™ˆ

⭐ RETURN VALUE ⭐

this call returns the CS_OK value if it worked out, and otherwise an error gets returned. that's it. that's the deal.


πŸ’€ ERRORS πŸ’€

okay here's the full lineup of things that can go wrong, and every single one of them counts, so don't skip:

  • CS_ERR_TRY_AGAIN β€” Resource temporarily unavailable
  • CS_ERR_INVALID_PARAM β€” Invalid argument
  • CS_ERR_ACCESS β€” Permission denied
  • CS_ERR_LIBRARY β€” The connection failed
  • CS_ERR_INTERRUPT β€” System call interrupted by a signal
  • CS_ERR_NOT_SUPPORTED β€” The requested protocol/functionality not supported
  • CS_ERR_MESSAGE_ERROR β€” Incorrect auth message received
  • CS_ERR_NO_MEMORY β€” Not enough memory to complete the requested task
lowkey if you see CS_ERR_TRY_AGAIN from a nonblocking dispatch, that's not a crisis, that's literally the documented behaviour. breathe 🧚

🌈 SEE ALSO 🌈

go read these next, bestie, they're the whole friend group:


and that's the page!! πŸŽ€βœ¨ this was the corosync Man Page, dated 2026-09-04, and you read the whole thing, so you're officially iconic. go dispatch some callbacks, you absolute legend πŸ‘‘πŸ’–

πŸ“¦ where this page comes from