qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject qpid-proton git commit: NO-JIRA: c++: remove blocking examples
Date Mon, 18 Jan 2016 14:24:17 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master b3e143acc -> 5f52012f5


NO-JIRA: c++: remove blocking examples

Plan to replace this functionality with the connection_engine, will add new
examples at that point.


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

Branch: refs/heads/master
Commit: 5f52012f58951907f4d472cf3003da08e69f1135
Parents: b3e143a
Author: Alan Conway <aconway@redhat.com>
Authored: Mon Jan 18 09:19:43 2016 -0500
Committer: Alan Conway <aconway@redhat.com>
Committed: Mon Jan 18 09:21:20 2016 -0500

----------------------------------------------------------------------
 examples/cpp/CMakeLists.txt          |  2 -
 examples/cpp/README.hpp              | 19 +--------
 examples/cpp/example_test.py         | 13 ------
 examples/cpp/helloworld_blocking.cpp | 52 ------------------------
 examples/cpp/sync_client.cpp         | 67 -------------------------------
 5 files changed, 1 insertion(+), 152 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/5f52012f/examples/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt
index 48049d4..bb5f9c8 100644
--- a/examples/cpp/CMakeLists.txt
+++ b/examples/cpp/CMakeLists.txt
@@ -24,13 +24,11 @@ include_directories(${ProtonCpp_INCLUDE_DIRS})
 set(examples
   broker
   helloworld
-  helloworld_blocking
   helloworld_direct
   simple_recv
   simple_send
   direct_recv
   direct_send
-  sync_client
   client
   server
   server_direct

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/5f52012f/examples/cpp/README.hpp
----------------------------------------------------------------------
diff --git a/examples/cpp/README.hpp b/examples/cpp/README.hpp
index 64ff2da..4e94ec0 100644
--- a/examples/cpp/README.hpp
+++ b/examples/cpp/README.hpp
@@ -29,16 +29,6 @@ can be built using the API.
 
 */
 
-/** \example helloworld_blocking.cpp
-
-The same as the basic helloworld.cpp, but using a
-synchronous/sequential style wrapper on top of the
-asynchronous/reactive API. The purpose of this example is just to show
-how different functionality can be easily layered should it be
-desired.
-
-*/
-
 /** \example simple_send.cpp
 
 An example of sending a fixed number of messages and tracking their
@@ -104,14 +94,7 @@ alternatives.
 
 */
 
-/** \example sync_client.cpp
-
-A variant of the client part, that uses a blocking/synchronous style
-instead of the reactive/asynchronous style.
-
-*/
-
-/** \example broker.hpp
+** \example broker.hpp
 
 Common logic for a simple "mini broker" that creates creates queues
 automatically when a client tries to send or subscribe. This file contains

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/5f52012f/examples/cpp/example_test.py
----------------------------------------------------------------------
diff --git a/examples/cpp/example_test.py b/examples/cpp/example_test.py
index c1e7ac5..9aa390c 100644
--- a/examples/cpp/example_test.py
+++ b/examples/cpp/example_test.py
@@ -127,11 +127,6 @@ class ExampleTest(unittest.TestCase):
         hw = execute("helloworld", b.addr)
         self.assertEqual('Hello World!\n', hw)
 
-    def test_helloworld_blocking(self):
-        b = Broker.get()
-        hw = execute("helloworld_blocking", b.addr)
-        self.assertEqual('Hello World!\n', hw)
-
     def test_helloworld_direct(self):
         addr = pick_addr()
         hw = execute("helloworld_direct", addr)
@@ -187,14 +182,6 @@ And the mome raths outgrabe. => AND THE MOME RATHS OUTGRABE.
         finally:
             server.kill()
 
-    def test_request_response_sync(self):
-        b = Broker.get()
-        server = background("server", "-a", b.addr)
-        try:
-            self.assertEqual(execute("sync_client", "-a", b.addr), self.CLIENT_EXPECT)
-        finally:
-            server.kill()
-
     def test_request_response_direct(self):
         addr = pick_addr()
         server = background("server_direct", "-a", addr+"/examples")

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/5f52012f/examples/cpp/helloworld_blocking.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/helloworld_blocking.cpp b/examples/cpp/helloworld_blocking.cpp
deleted file mode 100644
index a67276e..0000000
--- a/examples/cpp/helloworld_blocking.cpp
+++ /dev/null
@@ -1,52 +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.
- *
- */
-
-#include "proton/messaging_handler.hpp"
-#include "proton/blocking_connection.hpp"
-#include "proton/blocking_sender.hpp"
-#include "proton/blocking_receiver.hpp"
-#include "proton/duration.hpp"
-#include "proton/url.hpp"
-
-#include <iostream>
-
-int main(int argc, char **argv) {
-    try {
-        proton::url url(argc > 1 ? argv[1] : "127.0.0.1:5672/examples");
-        proton::blocking_connection conn(url);
-        proton::blocking_receiver receiver(conn, url.path());
-        proton::blocking_sender sender(conn, url.path());
-
-        proton::message m("Hello World!");
-        sender.send(m);
-
-        proton::duration timeout(30000);
-        proton::message m2 = receiver.receive(timeout);
-        std::cout << m2.body() << std::endl;
-        receiver.accept();
-
-        conn.close();
-        return 0;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-    return 1;
-}

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/5f52012f/examples/cpp/sync_client.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/sync_client.cpp b/examples/cpp/sync_client.cpp
deleted file mode 100644
index 9493579..0000000
--- a/examples/cpp/sync_client.cpp
+++ /dev/null
@@ -1,67 +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.
- *
- */
-
-#include "options.hpp"
-
-#include "proton/container.hpp"
-#include "proton/blocking_connection.hpp"
-#include "proton/request_response.hpp"
-#include "proton/url.hpp"
-#include "proton/types.hpp"
-
-#include <iostream>
-#include <vector>
-#include <string>
-
-
-int main(int argc, char **argv) {
-    // Command line options
-    proton::url url("127.0.0.1:5672/examples");
-    uint64_t timeout(5000);
-    options opts(argc, argv);
-    opts.add_value(url, 'a', "address", "connect to URL", "URL");
-    opts.add_value(timeout, 't', "timeout", "give up after this TIMEOUT (milliseconds)",
"TIMEOUT");
-
-    std::vector<std::string> requests;
-    requests.push_back("Twas brillig, and the slithy toves");
-    requests.push_back("Did gire and gymble in the wabe.");
-    requests.push_back("All mimsy were the borogroves,");
-    requests.push_back("And the mome raths outgrabe.");
-
-    try {
-        opts.parse();
-
-        proton::blocking_connection conn(url, proton::duration(timeout));
-        proton::request_response client(conn, url.path());
-        for (std::vector<std::string>::const_iterator i=requests.begin(); i != requests.end();
i++) {
-            proton::message request;
-            request.body(*i);
-            proton::message response(client.call(request));
-            std::cout << request.body() << " => " << response.body()
<< std::endl;
-        }
-        return 0;
-    } catch (const bad_option& e) {
-        std::cout << opts << std::endl << e.what() << std::endl;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-    return 1;
-}


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


Mime
View raw message