diff options
author | Craig Tiller <ctiller@google.com> | 2016-09-16 12:11:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-16 12:11:11 -0700 |
commit | ee43d7bbb11a36c91c6f1ebff6bf3da70b7546b2 (patch) | |
tree | 46e7b607b14425dc575520f089f4e9373322f250 /src/core/lib/transport/transport.h | |
parent | d72df881d62a89c7bb55424740cea8dbb58c99f3 (diff) | |
parent | 57726ca5a9c08ba17c882a798b93e03d333edd9f (diff) |
Merge pull request #8069 from grpc/revert-8068-revert-7279-grand-unified-closures
Revert "Revert "Grand unified closures""
Diffstat (limited to 'src/core/lib/transport/transport.h')
-rw-r--r-- | src/core/lib/transport/transport.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/core/lib/transport/transport.h b/src/core/lib/transport/transport.h index 26ed6cb839..8dc393fd61 100644 --- a/src/core/lib/transport/transport.h +++ b/src/core/lib/transport/transport.h @@ -100,6 +100,11 @@ void grpc_transport_move_one_way_stats(grpc_transport_one_way_stats *from, void grpc_transport_move_stats(grpc_transport_stream_stats *from, grpc_transport_stream_stats *to); +typedef struct { + grpc_closure closure; + void *args[2]; +} grpc_transport_private_op_data; + /* Transport stream op: a set of operations to perform on a transport against a single stream */ typedef struct grpc_transport_stream_op { @@ -149,6 +154,12 @@ typedef struct grpc_transport_stream_op { /* Indexes correspond to grpc_context_index enum values */ grpc_call_context_element *context; + + /*************************************************************************** + * remaining fields are initialized and used at the discretion of the + * transport implementation */ + + grpc_transport_private_op_data transport_private; } grpc_transport_stream_op; /** Transport op: a set of operations to perform on a transport as a whole */ @@ -182,6 +193,12 @@ typedef struct grpc_transport_op { grpc_pollset_set *bind_pollset_set; /** send a ping, call this back if not NULL */ grpc_closure *send_ping; + + /*************************************************************************** + * remaining fields are initialized and used at the discretion of the + * transport implementation */ + + grpc_transport_private_op_data transport_private; } grpc_transport_op; /* Returns the amount of memory required to store a grpc_stream for this @@ -273,6 +290,10 @@ void grpc_transport_destroy(grpc_exec_ctx *exec_ctx, grpc_transport *transport); char *grpc_transport_get_peer(grpc_exec_ctx *exec_ctx, grpc_transport *transport); +/* Allocate a grpc_transport_op, and preconfigure the on_consumed closure to + \a on_consumed and then delete the returned transport op */ +grpc_transport_op *grpc_make_transport_op(grpc_closure *on_consumed); + #ifdef __cplusplus } #endif |