You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2016/11/23 16:10:30 UTC

[1/2] qpid-proton git commit: PROTON-1344: removed unused pn_listener_free, update proactor doc.

Repository: qpid-proton
Updated Branches:
  refs/heads/master 331e3b9fa -> 6af49b819


PROTON-1344: removed unused pn_listener_free, update proactor doc.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/6af49b81
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/6af49b81
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/6af49b81

Branch: refs/heads/master
Commit: 6af49b819edb0d7d3aaa9968fc5ee1651f77f492
Parents: 468b719
Author: Alan Conway <ac...@redhat.com>
Authored: Wed Nov 23 11:07:44 2016 -0500
Committer: Alan Conway <ac...@redhat.com>
Committed: Wed Nov 23 11:08:08 2016 -0500

----------------------------------------------------------------------
 examples/c/proactor/libuv_proactor.c | 18 +++++++++---------
 proton-c/include/proton/listener.h   | 11 ++++++-----
 proton-c/include/proton/proactor.h   | 31 ++++++++++++++++++++-----------
 3 files changed, 35 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6af49b81/examples/c/proactor/libuv_proactor.c
----------------------------------------------------------------------
diff --git a/examples/c/proactor/libuv_proactor.c b/examples/c/proactor/libuv_proactor.c
index 9770166..42bbfab 100644
--- a/examples/c/proactor/libuv_proactor.c
+++ b/examples/c/proactor/libuv_proactor.c
@@ -810,6 +810,15 @@ static pn_event_t *proactor_batch_next(pn_event_batch_t *batch) {
   return pn_collector_next(batch_proactor(batch)->collector);
 }
 
+static void pn_listener_free(pn_listener_t *l) {
+  if (l) {
+    if (!l->collector) pn_collector_free(l->collector);
+    if (!l->condition) pn_condition_free(l->condition);
+    if (!l->attachments) pn_free(l->attachments);
+    free(l);
+  }
+}
+
 pn_listener_t *pn_listener() {
   pn_listener_t *l = (pn_listener_t*)calloc(1, sizeof(pn_listener_t));
   if (l) {
@@ -825,15 +834,6 @@ pn_listener_t *pn_listener() {
   return l;
 }
 
-void pn_listener_free(pn_listener_t *l) {
-  if (l) {
-    if (!l->collector) pn_collector_free(l->collector);
-    if (!l->condition) pn_condition_free(l->condition);
-    if (!l->attachments) pn_free(l->attachments);
-    free(l);
-  }
-}
-
 void pn_listener_close(pn_listener_t* l) {
   wakeup(&l->psocket, leader_close);
 }

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6af49b81/proton-c/include/proton/listener.h
----------------------------------------------------------------------
diff --git a/proton-c/include/proton/listener.h b/proton-c/include/proton/listener.h
index cd3d95f..dda1638 100644
--- a/proton-c/include/proton/listener.h
+++ b/proton-c/include/proton/listener.h
@@ -48,15 +48,16 @@ typedef struct pn_listener_t pn_listener_t;
 
 /**
  * Create a listener.
+ *
+ * You can use pn_listener_set_context() or pn_listener_attachments() to set
+ * application data that can be accessed when accepting connections.
+ *
+ * You must pass the returned listener to pn_proactor_listen(), the proactor
+ * will free the listener when it is no longer active.
  */
 PN_EXTERN pn_listener_t *pn_listener(void);
 
 /**
- * Free a listener
- */
-PN_EXTERN void pn_listener_free(pn_listener_t*);
-
-/**
  * Asynchronously accept a connection using the listener.
  *
  * @param[in] connection the listener takes ownership, do not free.

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6af49b81/proton-c/include/proton/proactor.h
----------------------------------------------------------------------
diff --git a/proton-c/include/proton/proactor.h b/proton-c/include/proton/proactor.h
index cd44526..fdb723b 100644
--- a/proton-c/include/proton/proactor.h
+++ b/proton-c/include/proton/proactor.h
@@ -62,7 +62,8 @@ typedef struct pn_proactor_t pn_proactor_t;
 pn_proactor_t *pn_proactor(void);
 
 /**
- * Free the proactor.
+ * Free the proactor. Abort any open network connections and clean up all
+ * associated resources.
  */
 void pn_proactor_free(pn_proactor_t*);
 
@@ -97,7 +98,7 @@ int pn_proactor_listen(pn_proactor_t *, pn_listener_t *listener, const char *hos
  * Wait for events to handle.
  *
  * Handle events in the returned batch by calling pn_event_batch_next() until it
- * returns NULL. You must call pn_proactor_done() to when you are finished.
+ * returns NULL. You must call pn_proactor_done() when you are finished with the batch.
  *
  * If you call pn_proactor_done() before finishing the batch, the remaining
  * events will be returned again by another call pn_proactor_wait().  This is
@@ -108,21 +109,28 @@ int pn_proactor_listen(pn_proactor_t *, pn_listener_t *listener, const char *hos
  * handled in sequence, but batches returned by separate calls to
  * pn_proactor_wait() can be handled concurrently.
  */
-pn_event_batch_t *pn_proactor_wait(pn_proactor_t* d);
+pn_event_batch_t *pn_proactor_wait(pn_proactor_t *d);
 
 /**
- * Call when done handling events.
+ * Call when done handling a batch of events.
  *
  * Must be called exactly once to match each call to pn_proactor_wait().
  *
- * Thread safe: may be called from any thread provided the exactly once rules is
+ * Thread safe: may be called from any thread provided the exactly once rule is
  * respected.
  */
-void pn_proactor_done(pn_proactor_t* d, pn_event_batch_t *events);
+void pn_proactor_done(pn_proactor_t *d, pn_event_batch_t *events);
 
 /**
- * Cause PN_PROACTOR_INTERRUPT to be returned to exactly one thread calling wait()
- * for each call to pn_proactor_interrupt(). Thread safe.
+ * Cause PN_PROACTOR_INTERRUPT to be returned to exactly one call of
+ * pn_proactor_wait().
+ *
+ * If threads are blocked in pn_proactor_wait(), one of them will be
+ * interrupted, otherwise the interrupt will be returned by a future call to
+ * pn_proactor_wait(). Calling pn_proactor_interrupt() N times will return
+ * PN_PROACTOR_INTERRUPT to N current or future calls of pn_proactor_wait()
+ *
+ * Thread safe.
  */
 void pn_proactor_interrupt(pn_proactor_t* d);
 
@@ -131,8 +139,9 @@ void pn_proactor_interrupt(pn_proactor_t* d);
  * timeout milliseconds. Thread safe.
  *
  * Note calling pn_proactor_set_timeout() again before the PN_PROACTOR_TIMEOUT is
- * delivered will cancel the previous timeout and deliver an event only after
- * the new timeout.
+  *delivered will cancel the previous timeout and deliver an event only after
+ * the new timeout. ::pn_proactor_set_timeout(0) will cancel the timeout
+ * without setting a new one.
  */
 void pn_proactor_set_timeout(pn_proactor_t* d, pn_millis_t timeout);
 
@@ -140,7 +149,7 @@ void pn_proactor_set_timeout(pn_proactor_t* d, pn_millis_t timeout);
  * Cause a PN_CONNECTION_WAKE event to be returned by the proactor, even if
  * there are no IO events pending for the connection.
  *
- * Thread safe: this is the only pn_connection_ function that can be
+ * **Thread safe**: this is the only pn_connection_ function that can be
  * called concurrently.
  *
  * Wakes can be "coalesced" - if several pn_connection_wake() calls happen


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[2/2] qpid-proton git commit: NO-JIRA: Delete dead code - cdriver jython shim

Posted by ac...@apache.org.
NO-JIRA: Delete dead code - cdriver jython shim


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/468b719d
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/468b719d
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/468b719d

Branch: refs/heads/master
Commit: 468b719da05222da77f72f25a026aea46352a372
Parents: 331e3b9
Author: Alan Conway <ac...@redhat.com>
Authored: Mon Nov 21 14:34:30 2016 -0500
Committer: Alan Conway <ac...@redhat.com>
Committed: Wed Nov 23 11:08:08 2016 -0500

----------------------------------------------------------------------
 tests/java/shim/cdriver.py | 69 -----------------------------------------
 tests/java/shim/cproton.py |  1 -
 2 files changed, 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/468b719d/tests/java/shim/cdriver.py
----------------------------------------------------------------------
diff --git a/tests/java/shim/cdriver.py b/tests/java/shim/cdriver.py
deleted file mode 100644
index a7a20f0..0000000
--- a/tests/java/shim/cdriver.py
+++ /dev/null
@@ -1,69 +0,0 @@
-#
-# 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.
-#
-from org.apache.qpid.proton import Proton
-
-# from proton/driver.h
-
-def pn_driver():
-  return Proton.driver()
-
-def pn_driver_wait(drv, t):
-  drv.doWait(t)
-
-def pn_driver_listener(drv):
-  return drv.listener()
-
-def pn_driver_connector(drv):
-  return drv.connector()
-
-def pn_listener(drv, host, port, ctx):
-  return drv.createListener(host, int(port), ctx)
-
-def pn_listener_context(l):
-  return l.getContext()
-
-def pn_listener_set_context(l, v):
-  l.setContext(v)
-
-def pn_listener_accept(l):
-  return l.accept()
-
-def pn_connector(drv, host, port, ctx):
-  return drv.createConnector(host, int(port), ctx)
-
-def pn_connector_context(c):
-  return c.getContext()
-
-def pn_connector_set_context(c, v):
-  c.setContext(v)
-
-def pn_connector_set_connection(c, conn):
-  c.setConnection(conn.impl)
-
-def pn_connector_connection(c):
-  return wrap(c.getConnection(), pn_connection_wrapper)
-
-def pn_connector_transport(c):
-  return wrap(c.getTransport(), pn_transport_wrapper)
-
-def pn_connector_process(c):
-  return c.process()
-
-def pn_connector_closed(c):
-  return c.isClosed()

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/468b719d/tests/java/shim/cproton.py
----------------------------------------------------------------------
diff --git a/tests/java/shim/cproton.py b/tests/java/shim/cproton.py
index 0840273..d5ed574 100644
--- a/tests/java/shim/cproton.py
+++ b/tests/java/shim/cproton.py
@@ -35,7 +35,6 @@ from ccodec import *
 from cengine import *
 from csasl import *
 from cssl import *
-from cdriver import *
 from cmessenger import *
 from cmessage import *
 from curl import *


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org