Skip to content

Commit

Permalink
Merge pull request #1089 from garlick/rpc_futures2
Browse files Browse the repository at this point in the history
reimplement RPC in terms of futures
  • Loading branch information
grondo committed Jun 13, 2017
2 parents 89dafb9 + 983b17b commit 609d88f
Show file tree
Hide file tree
Showing 54 changed files with 785 additions and 1,206 deletions.
31 changes: 12 additions & 19 deletions doc/man3/Makefile.am
Expand Up @@ -13,7 +13,6 @@ MAN3_FILES_PRIMARY = \
flux_msg_encode.3 \
flux_msg_sendfd.3 \
flux_rpc.3 \
flux_rpc_then.3 \
flux_mrpc.3 \
flux_reduce_create.3 \
flux_get_rank.3 \
Expand All @@ -33,7 +32,6 @@ MAN3_FILES_PRIMARY = \
flux_child_watcher_create.3 \
flux_signal_watcher_create.3 \
flux_stat_watcher_create.3 \
flux_rpc_raw.3 \
flux_respond.3 \
flux_reactor_now.3 \
flux_request_decode.3 \
Expand All @@ -59,14 +57,6 @@ MAN3_FILES_SECONDARY = \
flux_pollfd.3 \
flux_msg_decode.3 \
flux_msg_recvfd.3 \
flux_rpc_destroy.3 \
flux_rpc_check.3 \
flux_rpc_get.3 \
flux_rpcf_multi.3 \
flux_rpc_next.3 \
flux_rpc_get_nodeid.3 \
flux_rpcf.3 \
flux_rpc_getf.3 \
flux_reduce_destroy.3 \
flux_reduce_append.3 \
flux_reduce_pop.3 \
Expand Down Expand Up @@ -100,7 +90,6 @@ MAN3_FILES_SECONDARY = \
flux_child_watcher_get_rstatus.3 \
flux_signal_watcher_get_signum.3 \
flux_stat_watcher_get_rstat.3 \
flux_rpc_get_raw.3 \
flux_respond_raw.3 \
flux_respondf.3 \
flux_reactor_now_update.3 \
Expand All @@ -125,7 +114,12 @@ MAN3_FILES_SECONDARY = \
flux_future_aux_set.3 \
flux_future_aux_get.3 \
flux_future_set_flux.3 \
flux_future_get_flux.3
flux_future_get_flux.3 \
flux_rpcf.3 \
flux_rpc_raw.3 \
flux_rpc_get.3 \
flux_rpc_getf.3 \
flux_rpc_get_raw.3

ADOC_FILES = $(MAN3_FILES_PRIMARY:%.3=%.adoc)
XML_FILES = $(MAN3_FILES_PRIMARY:%.3=%.xml)
Expand Down Expand Up @@ -160,11 +154,6 @@ flux_event_unsubscribe.3: flux_event_subscribe.3
flux_pollfd.3: flux_pollevents.3
flux_msg_decode.3: flux_msg_encode.3
flux_msg_recvfd.3: flux_msg_sendfd.3
flux_rpc_destroy.3: flux_rpc.3
flux_rpc_get.3: flux_rpc.3
flux_rpc_getf.3: flux_rpc.3
flux_rpcf.3: flux_rpc.3
flux_rpc_check.3: flux_rpc_then.3
flux_reduce_destroy.3: flux_reduce_create.3
flux_reduce_append.3: flux_reduce_create.3
flux_reduce_pop.3: flux_reduce_create.3
Expand Down Expand Up @@ -198,7 +187,6 @@ flux_child_watcher_get_rpid.3: flux_child_watcher_create.3
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_rpc_get_raw.3: flux_rpc_raw.3
flux_respond_raw.3: flux_respond.3
flux_respondf.3: flux_respond.3
flux_reactor_now_update.3: flux_reactor_now.3
Expand All @@ -224,13 +212,18 @@ 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_raw.3: flux_rpc.3
flux_rpc_get.3: flux_rpc.3
flux_rpc_getf.3: flux_rpc.3
flux_rpc_get_raw.3: flux_rpc.3

flux_open.3: topen.c
flux_send.3: tsend.c
flux_recv.3: trecv.c
flux_event_subscribe.3: tevent.c
flux_rpc.3: trpc.c
flux_rpc_then.3: trpc_then.c
flux_rpc.3: trpc_then.c
flux_mrpc.3: tmrpc_then.c
flux_reduce_create.3: treduce.c
flux_get_rank.3: tinfo.c
Expand Down
32 changes: 16 additions & 16 deletions doc/man3/flux_content_load.adoc
Expand Up @@ -12,21 +12,21 @@ SYNOPSIS
--------
#include <flux/core.h>

flux_rpc_t *flux_content_load (flux_t *h,
const char *blobref,
int flags);
flux_future_t *flux_content_load (flux_t *h,
const char *blobref,
int flags);

int flux_content_load_get (flux_rpc_t *rpc,
int flux_content_load_get (flux_future_t *f,
void *buf,
size_t *len);


flux_rpc_t *flux_content_store (flux_t *h,
const void *buf,
size_t len,
int flags);
flux_future_t *flux_content_store (flux_t *h,
const void *buf,
size_t len,
int flags);

int flux_content_store_get (flux_rpc_t *rpc,
int flux_content_store_get (flux_future_t *f,
const char **ref);


Expand All @@ -39,27 +39,27 @@ All functions described below are idempotent.
`flux_content_load()` sends a request to the content service
to load a data blob by _blobref_, a hash digest whose format
is described in RFC 10. A `flux_rpc_t` object which encapsulates the
is described in RFC 10. A `flux_future_t` object which encapsulates the
remote procedure call state is returned. _flags_ is a mask that may
include the values described below.
`flux_request_load_get()` completes a load operation, blocking on
response(s) if needed, parsing the result, and returning the requested
blob in _buf_ and its length in _len_. _buf_ is valid until
`flux_rpc_destroy()` is called.
`flux_future_destroy()` is called.
`flux_content_store()` sends a request to the content service
to store a data blob _buf_ of length _len_. A `flux_rpc_t`
to store a data blob _buf_ of length _len_. A `flux_future_t`
object which encapsulates the remote procedure call state is returned.
_flags_ is a mask that may include the values described below.
`flux_content_store_get()` completes a store operation, blocking on
response(s) if needed, and returning a blobref that can be used to
retrieve the stored blob. The blobref string is valid until
`flux_rpc_destroy()` is called.
`flux_future_destroy()` is called.
These functions may be used asynchronously.
See `flux_rpc_then(3)` for details.
See `flux_future_then(3)` for details.
FLAGS
Expand All @@ -81,7 +81,7 @@ RETURN VALUE
------------
`flux_content_load()` and `flux_content_store()` return a
`flux_rpc_t` on success, or NULL on failure with errno set appropriately.
`flux_future_t` on success, or NULL on failure with errno set appropriately.
`flux_content_load_get()` and `flux_content_store_get()`
return 0 on success, or -1 on failure with errno set appropriately.
Expand Down Expand Up @@ -132,6 +132,6 @@ include::COPYRIGHT.adoc[]
SEE ALSO
---------
flux_rpc(3), flux_rpc_then(3)
flux_rpc(3), flux_future_then(3)

https://github.com/flux-framework/rfc/blob/master/spec_10.adoc[RFC 10: Content Storage Service]
6 changes: 3 additions & 3 deletions doc/man3/flux_mrpc.adoc
Expand Up @@ -45,7 +45,7 @@ DESCRIPTION
`flux_mrpc()` encodes and sends a batch of request messages to multiple
ranks. A flux_mrpc_t object is returned which can be used with
`flux_mrpc_get()` and `flux_mrpc_next()` to obtain the decoded responses,
as they become available. The flux_rpc_t should finally be disposed of
as they become available. The flux_mrpc_t should finally be disposed of
using `flux_mrpc_destroy()`.
_topic_ must be set to a topic string representing the Flux
Expand All @@ -65,7 +65,7 @@ _flags_ may be zero or:
FLUX_RPC_NORESPONSE::
No response is expected. The request will not be assigned a matchtag,
and the flux_rpc_t returned by `flux_mrpc()` may be immediately destroyed.
and the flux_mrpc_t returned by `flux_mrpc()` may be immediately destroyed.
`flux_mrpc_get()` blocks until a matching response is received, then
decodes the result. For asynchronous response handling,
Expand Down Expand Up @@ -185,7 +185,7 @@ include::COPYRIGHT.adoc[]
SEE ALSO
---------
flux_rpc(3), flux_mrpc_then(3)
flux_mrpc_then(3)
https://github.com/flux-framework/rfc/blob/master/spec_6.adoc[RFC 6: Flux
Remote Procedure Call Protocol]

0 comments on commit 609d88f

Please sign in to comment.