Skip to content

Commit

Permalink
Merge 693a8b4 into 03ace30
Browse files Browse the repository at this point in the history
  • Loading branch information
garlick committed Jul 13, 2017
2 parents 03ace30 + 693a8b4 commit 8cedc35
Show file tree
Hide file tree
Showing 67 changed files with 494 additions and 489 deletions.
26 changes: 13 additions & 13 deletions doc/man3/Makefile.am
Expand Up @@ -92,13 +92,13 @@ MAN3_FILES_SECONDARY = \
flux_signal_watcher_get_signum.3 \
flux_stat_watcher_get_rstat.3 \
flux_respond_raw.3 \
flux_respondf.3 \
flux_respond_pack.3 \
flux_reactor_now_update.3 \
flux_request_decodef.3 \
flux_request_unpack.3 \
flux_request_decode_raw.3 \
flux_event_decodef.3 \
flux_event_unpack.3 \
flux_event_encode.3 \
flux_event_encodef.3 \
flux_event_pack.3 \
flux_response_decode_raw.3 \
flux_request_encode_raw.3 \
flux_content_load_get.3 \
Expand All @@ -116,14 +116,14 @@ MAN3_FILES_SECONDARY = \
flux_future_aux_get.3 \
flux_future_set_flux.3 \
flux_future_get_flux.3 \
flux_rpcf.3 \
flux_rpc_pack.3 \
flux_rpc_raw.3 \
flux_rpc_get.3 \
flux_rpc_getf.3 \
flux_rpc_get_unpack.3 \
flux_rpc_get_raw.3 \
flux_kvs_lookupat.3 \
flux_kvs_lookup_get.3 \
flux_kvs_lookup_getf.3
flux_kvs_lookup_get_unpack.3

ADOC_FILES = $(MAN3_FILES_PRIMARY:%.3=%.adoc)
XML_FILES = $(MAN3_FILES_PRIMARY:%.3=%.xml)
Expand Down Expand Up @@ -192,13 +192,13 @@ flux_child_watcher_get_rstatus.3: flux_child_watcher_create.3
flux_signal_watcher_get_signum.3: flux_signal_watcher_create.3
flux_stat_watcher_get_rstat.3: flux_stat_watcher_create.3
flux_respond_raw.3: flux_respond.3
flux_respondf.3: flux_respond.3
flux_respond_pack.3: flux_respond.3
flux_reactor_now_update.3: flux_reactor_now.3
flux_request_decodef.3: flux_request_decode.3
flux_request_unpack.3: flux_request_decode.3
flux_request_decode_raw.3: flux_request_decode.3
flux_event_decodef.3: flux_event_decode.3
flux_event_unpack.3: flux_event_decode.3
flux_event_encode.3: flux_event_decode.3
flux_event_encodef.3: flux_event_decode.3
flux_event_pack.3: flux_event_decode.3
flux_response_decode_raw.3: flux_response_decode.3
flux_request_encode_raw.3: flux_request_encode.3
flux_content_load_get.3: flux_content_load.3
Expand All @@ -216,10 +216,10 @@ flux_future_aux_set.3: flux_future_create.3
flux_future_aux_get.3: flux_future_create.3
flux_future_set_flux.3: flux_future_create.3
flux_future_get_flux.3: flux_future_create.3
flux_rpcf.3: flux_rpc.3
flux_rpc_pack.3: flux_rpc.3
flux_rpc_raw.3: flux_rpc.3
flux_rpc_get.3: flux_rpc.3
flux_rpc_getf.3: flux_rpc.3
flux_rpc_get_unpack.3: flux_rpc.3
flux_rpc_get_raw.3: flux_rpc.3
flux_kvs_lookupat.3: flux_kvs_lookup.3
flux_kvs_get.3: flux_kvs_lookup.3
Expand Down
19 changes: 9 additions & 10 deletions doc/man3/flux_event_decode.adoc
Expand Up @@ -5,8 +5,7 @@ flux_event_decode(3)

NAME
----
flux_event_decode, flux_event_decodef, flux_event_encode, flux_event_encodef
- encode/decode a Flux event message
flux_event_decode, flux_event_unpack, flux_event_encode, flux_event_pack - encode/decode a Flux event message


SYNOPSIS
Expand All @@ -17,15 +16,15 @@ SYNOPSIS
const char **topic,
const char **json_str);

int flux_event_decodef (const flux_msg_t *msg,
const char **topic,
const char *fmt, ...);
int flux_event_unpack (const flux_msg_t *msg,
const char **topic,
const char *fmt, ...);

flux_msg_t *flux_event_encode (const char *topic,
const char *json_str);

flux_msg_t *flux_event_encodef (const char *topic,
const char *fmt, ...);
flux_msg_t *flux_event_pack (const char *topic,
const char *fmt, ...);


DESCRIPTION
Expand All @@ -40,7 +39,7 @@ _json_str_, if non-NULL, will be set to the message's JSON payload. If
no payload exists, _json_str_ is set to NULL. The storage for this
string belongs to _msg_ and should not be freed.
`flux_event_decodef()` decodes a Flux event message with a JSON payload as
`flux_event_unpack()` decodes a Flux event message with a JSON payload as
above, parsing the payload using variable arguments with a format string
in the style of jansson's `json_unpack()` (used internally). Decoding fails
if the message doesn't have a JSON payload.
Expand All @@ -49,9 +48,9 @@ if the message doesn't have a JSON payload.
and optional JSON payload _json_str_. The newly constructed message that
is returned must be destroyed with `flux_msg_destroy()`.
`flux_event_encodef()` encodes a Flux event message with a JSON payload as
`flux_event_pack()` encodes a Flux event message with a JSON payload as
above, encoding the payload using variable arguments with a format string
in the style of jansson's `json_unpack()` (used internally). Decoding fails
in the style of jansson's `json_pack()` (used internally). Decoding fails
if the message doesn't have a JSON payload.
Events propagated to all subscribers. Events will not be received
Expand Down
6 changes: 3 additions & 3 deletions doc/man3/flux_kvs_lookup.adoc
Expand Up @@ -5,7 +5,7 @@ flux_kvs_lookup(3)

NAME
----
flux_kvs_lookup, flux_kvs_lookupat, flux_kvs_lookup_get, flux_kvs_lookup_getf - look up KVS key
flux_kvs_lookup, flux_kvs_lookupat, flux_kvs_lookup_get, flux_kvs_lookup_get_unpack - look up KVS key


SYNOPSIS
Expand All @@ -19,7 +19,7 @@ SYNOPSIS

int flux_kvs_lookup_get (flux_future_t *f, const char **json_str);

int flux_kvs_lookup_getf (flux_future_t *f, const char *fmt, ...);
int flux_kvs_lookup_get_unpack (flux_future_t *f, const char *fmt, ...);


DESCRIPTION
Expand All @@ -44,7 +44,7 @@ response(s) if needed, parsing the result, and returning the requested
value in _json_str_. _buf_ is valid until `flux_future_destroy()` is called.
_json_str_ may be a JSON object, array, or bare value.
`flux_kvs_lookup_getf()` is identical to `flux_kvs_lookup_get()` except
`flux_kvs_lookup_get_unpack()` is identical to `flux_kvs_lookup_get()` except
the returned JSON is parsed according to variable arguments in Jansson
`json_unpack()` format.
Expand Down
10 changes: 5 additions & 5 deletions doc/man3/flux_request_decode.adoc
Expand Up @@ -5,7 +5,7 @@ flux_request_decode(3)

NAME
----
flux_request_decode, flux_request_decodef, flux_request_decode_raw - decode a Flux request message
flux_request_decode, flux_request_unpack, flux_request_decode_raw - decode a Flux request message


SYNOPSIS
Expand All @@ -16,9 +16,9 @@ SYNOPSIS
const char **topic,
const char **json_str);

int flux_request_decodef (const flux_msg_t *msg,
const char **topic,
const char *fmt, ...);
int flux_request_unpack (const flux_msg_t *msg,
const char **topic,
const char *fmt, ...);

int flux_request_decode_raw (const flux_msg_t *msg,
const char **topic,
Expand All @@ -36,7 +36,7 @@ _json_str_, if non-NULL, will be set to the message's JSON payload.
If no payload exists, _json_str_ is set to NULL. The storage for this
string belongs to _msg_ and should not be freed.
`flux_request_decodef()` decodes a request message with a JSON payload as
`flux_request_unpack()` decodes a request message with a JSON payload as
above, parsing the payload using variable arguments with a format string
in the style of jansson's `json_unpack()` (used internally). Decoding fails
if the message doesn't have a JSON payload.
Expand Down
10 changes: 5 additions & 5 deletions doc/man3/flux_respond.adoc
Expand Up @@ -5,7 +5,7 @@ flux_respond(3)

NAME
----
flux_respond, flux_respondf, flux_respond_raw - respond to a request
flux_respond, flux_respond_pack, flux_respond_raw - respond to a request


SYNOPSIS
Expand All @@ -15,8 +15,8 @@ SYNOPSIS
int flux_respond (flux_t *h, const flux_msg_t *request,
int errnum, const char *json_str);

int flux_respondf (flux_t *h, const flux_msg_t *request,
const char *fmt, ...);
int flux_respond_pack (flux_t *h, const flux_msg_t *request,
const char *fmt, ...);

int flux_respond_raw (flux_t *h, const flux_msg_t *request,
int errnum, const void *data, int length);
Expand All @@ -25,7 +25,7 @@ SYNOPSIS
DESCRIPTION
-----------
`flux_respond()`, `flux_respondf()`, and `flux_respond_raw()` encode
`flux_respond()`, `flux_respond_pack()`, and `flux_respond_raw()` encode
and send a response message on handle _h_, deriving topic string,
matchtag, and route stack from the provided _request_.
Expand All @@ -37,7 +37,7 @@ If _json_str_ is non-NULL, `flux_respond()` will send it as the response
payload, otherwise there will be no payload. Similarly, if _data_ is
non-NULL, `flux_respond_raw()` will send it as the response payload.
`flux_respondf()` encodes a response message with a JSON payload,
`flux_respond_pack()` encodes a response message with a JSON payload,
building the payload using variable arguments with a format string in
the style of jansson's `json_pack()` (used internally).
Expand Down
30 changes: 15 additions & 15 deletions doc/man3/flux_rpc.adoc
Expand Up @@ -5,7 +5,7 @@ flux_rpc(3)

NAME
----
flux_rpc, flux_rpcf, flux_rpc_raw, flux_rpc_get, flux_rpc_getf, flux_rpc_get_raw - perform a remote procedure call to a Flux service
flux_rpc, flux_rpc_pack, flux_rpc_raw, flux_rpc_get, flux_rpc_get_unpack, flux_rpc_get_raw - perform a remote procedure call to a Flux service


SYNOPSIS
Expand All @@ -16,17 +16,17 @@ SYNOPSIS
const char *json_str,
uint32_t nodeid, int flags);

flux_future_t *flux_rpcf (flux_t *h, const char *topic,
uint32_t nodeid, int flags,
const char *fmt, ...);
flux_future_t *flux_rpc_pack (flux_t *h, const char *topic,
uint32_t nodeid, int flags,
const char *fmt, ...);

flux_future_t *flux_rpc_raw (flux_t *h, const char *topic,
const void *data, int len,
uint32_t nodeid, int flags);

int flux_rpc_get (flux_future_t *f, const char **json_str);

int flux_rpc_getf (flux_future_t *f, const char *fmt, ...);
int flux_rpc_get_unpack (flux_future_t *f, const char *fmt, ...);

int flux_rpc_get_raw (flux_future_t *f, void *data, int *len);

Expand All @@ -36,7 +36,7 @@ DESCRIPTION
A remote procedure call (RPC) consists of a matched request and
response message exchanged with a Flux service. `flux_rpc()`,
`flux_rpcf()`, and `flux_rpc_raw()` encode and send a request message
`flux_rpc_pack()`, and `flux_rpc_raw()` encode and send a request message
via Flux broker handle _h_ to a Flux service identified by _topic_
and _nodeid_. A `flux_future_t` object is returned which acts as a handle
for synchronization and a container for the response message which in
Expand All @@ -47,7 +47,7 @@ turn contains the RPC result.
`flux_future_wait_for(3)` may be used to block until the
response has been received. Both accept an optional timeout.
`flux_rpc_get()`, `flux_rpc_getf()`, and `flux_rpc_get_raw()`
`flux_rpc_get()`, `flux_rpc_get_unpack()`, and `flux_rpc_get_raw()`
decode the RPC result. Internally, they call `flux_future_get()`
to access the response message stored in the future. If the response
message has not yet been received, these functions block until it is,
Expand All @@ -63,8 +63,8 @@ using one of the three `flux_rpc()` variants.
`flux_rpc()` attaches _json_str_, a serialized JSON string, as request
payload. If NULL, the request is encoded without a payload.

`flux_rpcf()` attaches a JSON payload encoded using Jansson `json_pack()`
style arguments (see below).
`flux_rpc_pack()` attaches a JSON payload encoded using Jansson
`json_pack()` style arguments (see below).

`flux_rpc_raw()` attaches a raw payload _data_ of length _len_, in bytes.
If _data_ is NULL, the request is encoded without a payload.
Expand Down Expand Up @@ -103,9 +103,9 @@ return an error.
payload contained in the RPC response. If there was no payload, _json_str_
is set to NULL.
`flux_rpc_getf()` decodes the JSON payload using Jansson `json_unpack()` style
arguments (see below). It is an error if there is no payload, or if the
payload is not JSON.
`flux_rpc_get_unpack()` decodes the JSON payload using Jansson `json_unpack()`
style arguments (see below). It is an error if there is no payload, or if
the payload is not JSON.
`flux_rpc_get_raw()` assigns the raw payload of the RPC response message
to _data_ and its length to _len_. If there is no payload, this function
Expand Down Expand Up @@ -135,11 +135,11 @@ on that handle.
RETURN VALUE
------------
`flux_rpc()`, `flux_rpcf()`, and `flux_rpc_raw()` return a flux_future_t
`flux_rpc()`, `flux_rpc_pack()`, and `flux_rpc_raw()` return a flux_future_t
object on success. On error, NULL is returned, and errno is set appropriately.
`flux_rpc_get()`, `flux_rpc_getf()`, and `flux_rpc_get_raw()` returns zero on
success. On error, -1 is returned, and errno is set appropriately.
`flux_rpc_get()`, `flux_rpc_get_unpack()`, and `flux_rpc_get_raw()` return
zero on success. On error, -1 is returned, and errno is set appropriately.
ERRORS
Expand Down
10 changes: 5 additions & 5 deletions doc/man3/trpc.c
Expand Up @@ -10,12 +10,12 @@ int main (int argc, char **argv)
if (!(h = flux_open (NULL, 0)))
log_err_exit ("flux_open");

if (!(f = flux_rpcf (h, "attr.get", FLUX_NODEID_ANY, 0,
"{s:s}", "name", "rank")))
log_err_exit ("flux_rpcf");
if (!(f = flux_rpc_pack (h, "attr.get", FLUX_NODEID_ANY, 0,
"{s:s}", "name", "rank")))
log_err_exit ("flux_rpc_pack");

if (flux_rpc_getf (f, "{s:s}", "value", &rankstr) < 0)
log_err_exit ("flux_rpc_getf");
if (flux_rpc_get_unpack (f, "{s:s}", "value", &rankstr) < 0)
log_err_exit ("flux_rpc_get_unpack");

printf ("rank is %s\n", rankstr);
flux_future_destroy (f);
Expand Down
10 changes: 5 additions & 5 deletions doc/man3/trpc_then.c
Expand Up @@ -5,8 +5,8 @@ void continuation (flux_future_t *f, void *arg)
{
const char *rankstr;

if (flux_rpc_getf (f, "{s:s}", "value", &rankstr) < 0)
log_err_exit ("flux_rpc_getf");
if (flux_rpc_get_unpack (f, "{s:s}", "value", &rankstr) < 0)
log_err_exit ("flux_rpc_get_unpack");

printf ("rank is %s\n", rankstr);
flux_future_destroy (f);
Expand All @@ -20,9 +20,9 @@ int main (int argc, char **argv)
if (!(h = flux_open (NULL, 0)))
log_err_exit ("flux_open");

if (!(f = flux_rpcf (h, "attr.get", FLUX_NODEID_ANY, 0,
"{s:s}", "name", "rank")))
log_err_exit ("flux_rpcf");
if (!(f = flux_rpc_pack (h, "attr.get", FLUX_NODEID_ANY, 0,
"{s:s}", "name", "rank")))
log_err_exit ("flux_rpc_pack");

if (flux_future_then (f, -1., continuation, NULL) < 0)
log_err_exit ("flux_future_then");
Expand Down
2 changes: 1 addition & 1 deletion src/bindings/lua/flux-lua.c
Expand Up @@ -315,7 +315,7 @@ static int l_flux_kvs_type (lua_State *L)
return lua_pusherror (L, "key expected in arg #2");

if ((future = flux_kvs_lookup (f, FLUX_KVS_READLINK, key))
&& flux_kvs_lookup_getf (future, "s", &target) == 0) {
&& flux_kvs_lookup_get_unpack (future, "s", &target) == 0) {
lua_pushstring (L, "symlink");
lua_pushstring (L, target);
flux_future_destroy (future);
Expand Down

0 comments on commit 8cedc35

Please sign in to comment.