You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by kgiusti <gi...@git.apache.org> on 2018/10/23 20:13:13 UTC
[GitHub] qpid-dispatch pull request #394: DISPATCH-1150: Router core messaging client
GitHub user kgiusti opened a pull request:
https://github.com/apache/qpid-dispatch/pull/394
DISPATCH-1150: Router core messaging client
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/kgiusti/dispatch DISPATCH-1150
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/qpid-dispatch/pull/394.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #394
----
commit 729ed4cadfe6b13599da8f33fa666c515f7807cd
Author: Kenneth Giusti <kg...@...>
Date: 2018-10-22T16:21:59Z
DISPATCH-1150: Router core messaging client
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org
[GitHub] qpid-dispatch pull request #394: DISPATCH-1150: Router core messaging client
Posted by ted-ross <gi...@git.apache.org>.
Github user ted-ross commented on a diff in the pull request:
https://github.com/apache/qpid-dispatch/pull/394#discussion_r228591596
--- Diff: src/router_core/core_client_api.h ---
@@ -0,0 +1,165 @@
+#ifndef qd_router_core_client_api_h
+#define qd_router_core_client_api_h 1
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// A simple request/response client messaging API using core terminated links
+//
+
+#include "router_core_private.h"
+
+
+typedef struct qdrc_client_t qdrc_client_t;
+
+
+//
+// client application callbacks
+//
+
+
+/**
+ * Client links have changed state
+ *
+ * @param core
+ * @param client - core client returned by qdrc_client_CT()
+ * @param user_context - as passed to qdrc_client_CT()
+ * @param active - true if both links are opened, else false
+ */
+typedef void (*qdrc_client_on_state_CT_t)(qdr_core_t *core,
+ qdrc_client_t *client,
+ uintptr_t user_context,
+ bool active);
+
+
+/**
+ * Credit has become available for sending messages
+ *
+ * @param core
+ * @param client - core client returned by qdrc_client_CT()
+ * @param user_context - as passed to qdrc_client_CT()
+ * @param available_credit - current credit allocation
+ * @param drain - if true client must consume all credit
+ */
+typedef void (*qdrc_client_on_flow_CT_t)(qdr_core_t *core,
+ qdrc_client_t *client,
+ uintptr_t user_context,
+ int available_credit,
+ bool drain);
+
+/**
+ * Final disposition received for sent message
+ *
+ * @param core
+ * @param client - core client returned by qdrc_client_CT()
+ * @param user_context - as passed to qdrc_client_CT()
+ * @param request_context - as passed to qdrc_client_request_CT()
+ * @param disposition - for the associated sent message
+ */
+typedef void (*qdrc_client_on_ack_CT_t)(qdr_core_t *core,
+ qdrc_client_t *client,
+ uintptr_t user_context,
+ uintptr_t request_context,
+ uint64_t disposition);
+
+/**
+ * A reply message has arrived for a given request
+ *
+ * @param core
+ * @param client - core client returned by qdrc_client_CT()
+ * @param user_context - as passed to qdrc_client_CT()
+ * @param app_properties - application properties header from reply.
+ * Ownership is handed off to this callback - user must free the
+ * iterator when done.
+ * @param body - message body. Ownership is handed off to this callback
+ * - user must free the iterator when done.
+ * @return final disposition for the received reply message
+ */
+typedef uint64_t (*qdrc_client_on_reply_CT_t)(qdr_core_t *core,
+ qdrc_client_t *client,
+ uintptr_t user_context,
+ uintptr_t request_context,
+ qd_iterator_t *app_properties,
+ qd_iterator_t *body);
+
+
+typedef void (*qdrc_client_request_done_CT_t)(qdr_core_t *core,
+ qdrc_client_t *client,
+ uintptr_t user_context,
+ uintptr_t request_context,
+ const char *error);
+
+
+/**
+ * Create a request/response client
+ *
+ * @param core
+ * @param conn - connection over which links will be created.
+ * @param target - for messages sent by this client.
+ * @param credit_window - for receiver link (credit loop)
+ * @param user_context - context that will be passed to callbacks
+ * @param on_state_cb - callback when link state changes
+ * @param on_flow_cb - callback when sender credit is updated.
+ * @return a new core client
+ */
+qdrc_client_t *qdrc_client_CT(qdr_core_t *core,
+ qdr_connection_t *conn,
+ qdr_terminus_t *target,
+ int credit_window,
+ uintptr_t user_context,
+ qdrc_client_on_state_CT_t on_state_cb,
+ qdrc_client_on_flow_CT_t on_flow_cb);
+
+
+/**
+ * Free a request/response client
+ *
+ * @param client - as returned by qdrc_client_CT()
+ */
+void qdrc_client_free_CT(qdrc_client_t *client);
+
+
+/**
+ * Send a request message
+ *
+ * @param client - as returned by qdrc_client_CT()
+ * @param request_context - context for this request that will be passed to
+ * callbacks
+
+ * @param app_properties - the application properties for the sent message.
+ * Ownership is transferred to this call - the caller must not reference the
+ * composed field on return.
+
+ * @param body - the message body for the sent message. Ownership is transferred
+ * to this call - the caller must not reference the composed field on return.
+
+ * @param on_reply_cb - (optional) invoked when reply message arrives
+ * @param on_ack_cb - (optional) invoked when sent message disposition is set
+ * @param done_cb - (optional) called once request is done (for cleanup)
+ * @return zero on success.
+ */
+int qdrc_client_request_CT(qdrc_client_t *client,
+ uintptr_t request_context,
--- End diff --
Why is the context not a void* ?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org
[GitHub] qpid-dispatch pull request #394: DISPATCH-1150: Router core messaging client
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/qpid-dispatch/pull/394
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org
[GitHub] qpid-dispatch issue #394: DISPATCH-1150: Router core messaging client
Posted by codecov-io <gi...@git.apache.org>.
Github user codecov-io commented on the issue:
https://github.com/apache/qpid-dispatch/pull/394
# [Codecov](https://codecov.io/gh/apache/qpid-dispatch/pull/394?src=pr&el=h1) Report
> Merging [#394](https://codecov.io/gh/apache/qpid-dispatch/pull/394?src=pr&el=desc) into [master](https://codecov.io/gh/apache/qpid-dispatch/commit/267207d2b73f1133a0ed16cac6c3c9e845019a85?src=pr&el=desc) will **increase** coverage by `0.08%`.
> The diff coverage is `88.15%`.
[](https://codecov.io/gh/apache/qpid-dispatch/pull/394?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #394 +/- ##
==========================================
+ Coverage 84.98% 85.07% +0.08%
==========================================
Files 76 77 +1
Lines 16817 17170 +353
==========================================
+ Hits 14292 14607 +315
- Misses 2525 2563 +38
```
| [Impacted Files](https://codecov.io/gh/apache/qpid-dispatch/pull/394?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/message.c](https://codecov.io/gh/apache/qpid-dispatch/pull/394/diff?src=pr&el=tree#diff-c3JjL21lc3NhZ2UuYw==) | `88.86% <100%> (+0.17%)` | :arrow_up: |
| [src/router\_core/core\_client\_api.c](https://codecov.io/gh/apache/qpid-dispatch/pull/394/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL2NvcmVfY2xpZW50X2FwaS5j) | `85.21% <85.21%> (ø)` | |
| [...c/router\_core/modules/test\_hooks/core\_test\_hooks.c](https://codecov.io/gh/apache/qpid-dispatch/pull/394/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL21vZHVsZXMvdGVzdF9ob29rcy9jb3JlX3Rlc3RfaG9va3MuYw==) | `91.93% <94.73%> (+1.02%)` | :arrow_up: |
| [src/router\_core/forwarder.c](https://codecov.io/gh/apache/qpid-dispatch/pull/394/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL2ZvcndhcmRlci5j) | `93.25% <0%> (-0.73%)` | :arrow_down: |
| [src/router\_node.c](https://codecov.io/gh/apache/qpid-dispatch/pull/394/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9ub2RlLmM=) | `93.52% <0%> (-0.39%)` | :arrow_down: |
| [src/router\_core/route\_tables.c](https://codecov.io/gh/apache/qpid-dispatch/pull/394/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL3JvdXRlX3RhYmxlcy5j) | `76.54% <0%> (-0.26%)` | :arrow_down: |
| [src/parse.c](https://codecov.io/gh/apache/qpid-dispatch/pull/394/diff?src=pr&el=tree#diff-c3JjL3BhcnNlLmM=) | `85.52% <0%> (+0.26%)` | :arrow_up: |
| [src/router\_core/connections.c](https://codecov.io/gh/apache/qpid-dispatch/pull/394/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL2Nvbm5lY3Rpb25zLmM=) | `95.37% <0%> (+0.32%)` | :arrow_up: |
| ... and [2 more](https://codecov.io/gh/apache/qpid-dispatch/pull/394/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/qpid-dispatch/pull/394?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/qpid-dispatch/pull/394?src=pr&el=footer). Last update [267207d...729ed4c](https://codecov.io/gh/apache/qpid-dispatch/pull/394?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org