mirror of
https://github.com/wassname/ray.git
synced 2026-07-14 11:17:54 +08:00
* draft of local scheduler * API * update APIs * fix * update * Rename halo -> photon. * Add build directory. * Update common submodule. * More renaming. * Fix python ctypes. * Compile in travis. * Process generic messages and not just tasks. * Move free outside of switch. * Formatting and address comments. * Remove event loop from local scheduler state. * Use accept_client from common. * Use bind_ipc_sock from common. * Fix tests. * Update common submodule. * Fix formatting.
28 lines
710 B
C
28 lines
710 B
C
#include "photon_client.h"
|
|
|
|
#include "common/io.h"
|
|
#include "common/task.h"
|
|
#include <stdlib.h>
|
|
|
|
photon_conn *photon_connect(const char *photon_socket) {
|
|
photon_conn *result = malloc(sizeof(photon_conn));
|
|
result->conn = connect_ipc_sock(photon_socket);
|
|
return result;
|
|
}
|
|
|
|
void photon_submit(photon_conn *conn, task_spec *task) {
|
|
write_message(conn->conn, SUBMIT_TASK, task_size(task), (uint8_t *)task);
|
|
}
|
|
|
|
void photon_task_done(photon_conn *conn) {
|
|
write_message(conn->conn, TASK_DONE, 0, NULL);
|
|
}
|
|
|
|
void photon_disconnect(photon_conn *conn) {
|
|
write_message(conn->conn, DISCONNECT_CLIENT, 0, NULL);
|
|
}
|
|
|
|
void photon_log_message(photon_conn *conn) {
|
|
write_message(conn->conn, LOG_MESSAGE, 0, NULL);
|
|
}
|