CMAP_DISPATCH(3)
π CMAP_DISPATCH π
okay bestie, gather round, because this is the Corosync Cluster Engine Programmer's Manual entry for cmap_dispatch, and honestly? it's giving "the function that makes your callbacks actually happen." β¨
πΈ NAME πΈ
cmap_dispatch β dispatches callbacks from the CMAP service π¦
Basically it's the little engine that goes and collects your callbacks and hands them to you. The CMAP service is out here holding your configuration changes, and this is the girl who knocks on the door and says "ma'am, your callbacks are ready." π
π SYNOPSIS π
#include <corosync/cmap.h>
cs_error_t cmap_dispatch (cmap_handle_t handle, cs_dispatch_flags_t
dispatch_types);
so you include <corosync/cmap.h> first β non-negotiable, no cap β and then you call cmap_dispatch with your handle and your dispatch_types. That's it, that's the whole thing. π
β¨ DESCRIPTION β¨
So the cmap_dispatch function is used to dispatch configuration changes. That's literally its whole job and it does it beautifully. π
Each application may have several connections to the CMAP API. Each application uses the handle argument to uniquely identify the connection. So like... one girl can have multiple group chats, and the handle is how you tell them apart. Don't mix them up, bestie. π
The dispatch_types argument is used to identify the type of dispatch to execute. The possible types are CS_DISPATCH_ONE, CS_DISPATCH_ALL and CS_DISPATCH_BLOCKING. Pick one. Choose your fighter. β
The dispatch values have the following meanings:
π« the dispatch values, explained with love π«
CS_DISPATCH_ONEβ Dispatch at least one callback, blocking until the callback is dispatched. So it'll wait, patiently, like a good friend outside the fitting room. πCS_DISPATCH_ALLβ Dispatch all waiting callbacks without blocking to wait for any callbacks. She's efficient, she's not waiting around, she's got places to be. β¨CS_DISPATCH_BLOCKINGβ Dispatch all callbacks blocking indefinitely. This is used in a threaded program where a thread is created, and thencs_dispatch()is called immediately from the created thread to execute callbacks. Indefinitely, bestie. Forever. Until further notice. πCS_DISPATCH_ONE_NONBLOCKINGβ Dispatch at most one callback. If there is no pending callback,CS_ERR_TRY_AGAINis returned. She checks, she's like "nope, nothing here," and she leaves. No loitering. π¦
It's needed to call cmap_track_add(3) to add tracked items and receive callbacks. Like, you literally cannot get callbacks without tracking something first. That's the prerequisite, that's the price of admission, that's the vibe check. π
π₯ RETURN VALUE π₯
This call returns the CS_OK value if successful, otherwise an error is returned. That's the whole deal. If you got CS_OK, we're slaying. If not... scroll down, bestie, there's a whole list. π
π SEE ALSO π
π the error codes (know them, fear them, respect them) π
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
fr fr, if you seeCS_ERR_TRY_AGAINafter aCS_DISPATCH_ONE_NONBLOCKINGcall, that's not a bug, that's just the function telling you there was nothing waiting. She's not ghosting you, there was genuinely no callback. π«Ά
and that's the whole page, bestie β go forth and dispatch your callbacks, you absolute icon, you main character, you configuration-change-receiving queen π
this has been the corosync Man Page, dated 23/01/2012, from the Corosync Cluster Engine Programmer's Manual β mwah, take care of her π
π¦ where this page comes from
- debian bookworm: libcmap-dev 3.1.7-1+deb12u2 Β· BSD-3-Clause
- debian trixie: libcmap-dev 3.1.9-2+deb13u1 Β· BSD-3-Clause
- epel 9: corosynclib-devel 3.1.10-0.2.el9.1 Β· BSD-3-Clause
- 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 43: corosynclib-devel 3.1.9-5.fc43 Β· BSD-3-Clause
- fedora 43: corosynclib-devel 3.1.9-5.fc43 Β· BSD-3-Clause
- fedora 44: corosynclib-devel 3.1.10-4.fc44 Β· BSD-3-Clause
- fedora 44: corosynclib-devel 3.1.10-4.fc44 Β· 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
- nixos 26.05: corosync 3.1.9
- nixpkgs unstable: corosync 3.1.9
- opensuse-leap 16.0: corosync-devel 3.1.9-160000.4.1 Β· BSD-3-Clause
- opensuse-leap 16.0: corosync-devel 3.1.9-160000.4.1 Β· BSD-3-Clause
- opensuse-leap 16.0: corosync-devel 3.1.9-160000.4.1 Β· BSD-3-Clause
- opensuse-leap 16.0: corosync-devel 3.1.9-160000.4.1 Β· BSD-3-Clause
- ubuntu jammy: libcmap-dev 3.1.6-1ubuntu1 Β· BSD-3-Clause
- ubuntu jammy: libcmap-dev 3.1.6-1ubuntu1.2 Β· BSD-3-Clause
- ubuntu noble: libcmap-dev 3.1.7-1ubuntu3 Β· BSD-3-Clause
- ubuntu noble: libcmap-dev 3.1.7-1ubuntu3.2 Β· BSD-3-Clause
- ubuntu questing: libcmap-dev 3.1.9-2ubuntu1
- ubuntu questing: libcmap-dev 3.1.9-2ubuntu1.1
- ubuntu resolute: libcmap-dev 3.1.9-2ubuntu3 Β· BSD-3-Clause
- ubuntu stonking: libcmap-dev 3.1.10-3ubuntu1 Β· BSD-3-Clause
- Copyright (c) 2012 Red Hat, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms