globus_callback.h(3)
globus_callback.h(3) β like, the Globus Callback API bestie π
okay so this whole thing lives in the Library Functions Manual, and it's literally the manual page for globus_callback.h, the header that is the Globus Callback API. no cap. grab a snack, we're going through all of it. π
β¨ NAME β¨
globus_callback.h β the Globus Callback API. that's it, that's the name, she's simple and she's iconic π
πΈ SYNOPSIS πΈ
bestie, you start by pulling in your includes, exactly like this:
#include 'globus_common_include.h'
#include 'globus_module.h'
#include 'globus_time.h'
then it's just vibes and categories. let's go. π¦
Macros
#define GLOBUS_CALLBACK_MODULEβ a module descriptor. yes, literally just a module descriptor.#define GLOBUS_POLL_MODULEβ also a module descriptor. two of them. we stay fed. π
Convenience Macros
these are the little shortcuts that make life so much easier, fr fr:
#define globus_callback_poll(a)β polls the global callback space.#define globus_poll_blocking()β a blocking poll of the global callback space. it will sit there and wait, no shame.#define globus_poll_nonblocking()β a nonblocking poll of the global callback space. in and out, no waiting around.#define globus_poll()β a nonblocking poll of the global callback space.#define globus_signal_poll()β wakes up the callback polling thread. good morning queen βοΈ#define globus_callback_register_oneshot( callback_handle, delay_time, callback_func, callback_user_arg)β registers a oneshot function in the global callback space.#define globus_callback_register_periodic( callback_handle, delay_time, period, callback_func, callback_user_arg)β registers a periodic function in the global callback space.#define globus_callback_register_signal_handler( signum, persist, callback_func, callback_user_arg)β registers a signal handler in the global callback space.
Typedefs
typedef int globus_callback_handle_tβ a periodic callback handle.typedef int globus_callback_space_tβ a callback space handle.typedef struct globus_l_callback_space_attr_s * globus_callback_space_attr_tβ a callback space attribute.
Callback Prototypes
typedef void(* globus_callback_func_t) (void *user_arg)β the Globus callback prototype. this is the shape every callback you write has to be. periodt.
Enumerations
enum globus_callback_error_type_t β error types π₯
the error girls, in order, and yes the numbers matter:
GLOBUS_CALLBACK_ERROR_INVALID_CALLBACK_HANDLE = 1024GLOBUS_CALLBACK_ERROR_INVALID_SPACEGLOBUS_CALLBACK_ERROR_MEMORY_ALLOCGLOBUS_CALLBACK_ERROR_INVALID_ARGUMENTGLOBUS_CALLBACK_ERROR_ALREADY_CANCELEDGLOBUS_CALLBACK_ERROR_NO_ACTIVE_CALLBACK
Functions
π«Ά Oneshot Callbacks
globus_result_t globus_callback_space_register_oneshot (globus_callback_handle_t *callback_handle, const globus_reltime_t *delay_time, globus_callback_func_t callback_func, void *callback_user_arg, globus_callback_space_t space)β registers a oneshot some delay from now.
π Periodic Callbacks
globus_result_t globus_callback_space_register_periodic (globus_callback_handle_t *callback_handle, const globus_reltime_t *delay_time, const globus_reltime_t *period, globus_callback_func_t callback_func, void *callback_user_arg, globus_callback_space_t space)β registers a periodic callback.globus_result_t globus_callback_unregister (globus_callback_handle_t callback_handle, globus_callback_func_t unregister_callback, void *unreg_arg, globus_bool_t *active)β unregisters a callback.globus_result_t globus_callback_adjust_oneshot (globus_callback_handle_t callback_handle, const globus_reltime_t *new_delay)β adjusts the delay of a oneshot callback.globus_result_t globus_callback_adjust_period (globus_callback_handle_t callback_handle, const globus_reltime_t *new_period)β adjusts the period of a periodic callback.
π« Callback Polling
void globus_callback_space_poll (const globus_abstime_t *timestop, globus_callback_space_t space)β polls for ready callbacks.void globus_callback_signal_poll ()β signals the poll.
Miscellaneous
the grab-bag section, and honestly she's giving main character energy π
#define GLOBUS_CALLBACK_GLOBAL_SPACEβ the global callback space.#define GLOBUS_SIGNAL_INTERRUPTβ yep, that's the whole thing, it's a define and it's doing its best.
enum globus_callback_space_behavior_t
callback space behaviors describe how a space behaves. iconic of them honestly:
GLOBUS_CALLBACK_SPACE_BEHAVIOR_SINGLEGLOBUS_CALLBACK_SPACE_BEHAVIOR_SERIALIZEDGLOBUS_CALLBACK_SPACE_BEHAVIOR_THREADED
and the rest of the functions
globus_bool_t globus_callback_get_timeout (globus_reltime_t *time_left)β gets the amount of time left in a callback. β³globus_bool_t globus_callback_has_time_expired ()β sees if there's remaining time in a callback.globus_bool_t globus_callback_was_restarted ()β sees if a callback has been restarted.globus_result_t globus_callback_space_init (globus_callback_space_t *space, globus_callback_space_attr_t attr)β initializes a user space.globus_result_t globus_callback_space_reference (globus_callback_space_t space)β takes a reference to a space.globus_result_t globus_callback_space_destroy (globus_callback_space_t space)β destroys a reference to a user space.globus_result_t globus_callback_space_attr_init (globus_callback_space_attr_t *attr)β initializes a space attr.globus_result_t globus_callback_space_attr_destroy (globus_callback_space_attr_t attr)β destroys a space attr.globus_result_t globus_callback_space_attr_set_behavior (globus_callback_space_attr_t attr, globus_callback_space_behavior_t behavior)β sets the behavior of a space.globus_result_t globus_callback_space_attr_get_behavior (globus_callback_space_attr_t attr, globus_callback_space_behavior_t *behavior)β gets the behavior associated with an attr.globus_result_t globus_callback_space_get (globus_callback_space_t *space)β retrieves the space of a currently running callback.int globus_callback_space_get_depth (globus_callback_space_t space)β retrieves the current nesting level of a space.globus_bool_t globus_callback_space_is_single (globus_callback_space_t space)β sees if the specified space is a single threaded behavior space.globus_result_t globus_callback_space_register_signal_handler (int signum, globus_bool_t persist, globus_callback_func_t callback_func, void *callback_user_arg, globus_callback_space_t space)β fires a callback when the specified signal is received. β‘globus_result_t globus_callback_unregister_signal_handler (int signum, globus_callback_func_t unregister_callback, void *unreg_arg)β unregisters a signal handling callback.void globus_callback_add_wakeup_handler (void(*wakeup)(void *), void *user_arg)β registers a wakeup handler with the callback library. rise and shine π
π Detailed Description π
Globus Callback API.
that's the whole detailed description bestie, she said what she said π
π Author π
Generated automatically by Doxygen for globus_common from the source code. not a human, just a robot doing her little documentation thing π€β¨
aaaand that's a wrap! this page is from globus_common, Version 18.15, and it's globus_callback.h(3). ty for coming to my ted talk, go forth and register your callbacks responsibly ππ¦πΈπ
π¦ where this page comes from
- epel 10: globus-common-doc 18.15-1.el10_2 Β· Apache-2.0
- fedora 43: globus-common-doc 18.15-1.fc43 Β· Apache-2.0
- fedora 44: globus-common-doc 18.15-2.fc44 Β· Apache-2.0
- ubuntu resolute: libglobus-common-doc 18.15-1 Β· Apache-2.0
- ubuntu stonking: libglobus-common-doc 18.15-2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms