mirror of
https://github.com/vale981/ray
synced 2025-03-13 22:56:38 -04:00

* Add ability to pass callback context to object table lookup * Propagate errors during socket writes up to caller. * Use recv and MSG_WAITALL flag instead of looping read * Error checking in write_bytes * Method to listen on a network port * Revert "Use recv and MSG_WAITALL flag instead of looping read" This reverts commit 32d9333bc6a185729aadb4b41b70b3d7f150a9c2. * Some documentation * Clearer documentation * Fix bug where database clients were getting assigned the same ID * Regression test for unique client IDs
25 lines
992 B
C
25 lines
992 B
C
#include "common.h"
|
|
#include "db.h"
|
|
|
|
/* The callback that is called when the result of a lookup
|
|
* in the object table comes back. The callback should free
|
|
* the manager_vector array, but NOT the strings they are pointing to. */
|
|
typedef void (*lookup_callback)(object_id object_id,
|
|
int manager_count,
|
|
const char *manager_vector[],
|
|
void *context);
|
|
|
|
/* Register a new object with the directory. */
|
|
/* TODO(pcm): Retry, print for each attempt. */
|
|
void object_table_add(db_handle *db, object_id object_id);
|
|
|
|
/* Remove object from the directory. */
|
|
void object_table_remove(db_handle *db,
|
|
object_id object_id,
|
|
const char *manager);
|
|
|
|
/* Look up entry from the directory */
|
|
void object_table_lookup(db_handle *db,
|
|
object_id object_id,
|
|
lookup_callback callback,
|
|
void *context);
|