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 thenquorum_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_AGAINis 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 unavailableCS_ERR_INVALID_PARAMβ Invalid argumentCS_ERR_ACCESSβ Permission deniedCS_ERR_LIBRARYβ The connection failedCS_ERR_INTERRUPTβ System call interrupted by a signalCS_ERR_NOT_SUPPORTEDβ The requested protocol/functionality not supportedCS_ERR_MESSAGE_ERRORβ Incorrect auth message receivedCS_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:
quorum_overview(3)quorum_initialize(3)quorum_model_initialize(3)quorum_finalize(3)quorum_getquorate(3)quorum_trackstart(3)quorum_trackstop(3)quorum_fd_get(3)quorum_context_set(3)quorum_context_get(3)
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
- fedora 43: corosynclib-devel 3.1.10-3.fc43 Β· BSD-3-Clause
- fedora 43: corosynclib-devel 3.1.10-3.fc43 Β· BSD-3-Clause
- fedora 44: corosynclib-devel 3.1.10-6.fc44 Β· BSD-3-Clause
- fedora 44: corosynclib-devel 3.1.10-6.fc44 Β· BSD-3-Clause
- Copyright (c) 2012-2020 Red Hat, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms