You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2016/05/16 14:44:13 UTC

[jira] [Commented] (PROTON-1184) c++: Merge the controller and container interfaces.

    [ https://issues.apache.org/jira/browse/PROTON-1184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15284666#comment-15284666 ] 

ASF subversion and git services commented on PROTON-1184:
---------------------------------------------------------

Commit 1b8450d6a7ff132a57419dfc5f9d0a659a04ff45 in qpid-proton's branch refs/heads/master from [~aconway]
[ https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;h=1b8450d ]

PROTON-1184: C++ merge APIs for single and multi-threaded use.

container is now an *interface*, slightly modified and suitable for ST and MT use.
  - controller is gone, connection_engine/IO integration use container interface
  - added default_container: single-threaded container implementation, like old container.
  - added listen_handler to react to accepted connections in container::listen.
    - renamed acceptor to listener
    - removed mutable acceptor options, now provided by listen_handler
  - thread_safe<Endpoint> used to return endpoints, safe for MT use.

thread_safe<Endpoint> provides thread safe access:
  - event_loop::inject() makes async/deferred function calls in endpoint context
  - endpoint stays in memory till thread_safe<Endpoint> is deleted
  - on deletion, thread_safe<Endpoint> safely injects a decref().
  - normal memory management: shared_ptr, unique_ptr, auto_ptr or operator delete.
  - returned_thread_safe<Endpoint> transparent conversion, old ST code unchanged.

connection_engine changes
  - connection_engine handler is optional (engine still updates model objects)
  - engine requires configure() before use - allow more leeway to compose options.
    - connect() does configure() and open() for a client connection
    - accept() does configure() for a server connection
  - renamed connection_engine::close->disconnected, distinct from AQMP protocol close

implicit convert handler to connection_options
 - handler as sole option is very common with MT handler-per-connection style

TODO:
- flow control C++ example is temporarily disabled, need to fix link-level handlers.
- thread_safe::inject() needs a time-delay version to replace container:;schedule.


> c++: Merge the controller and container interfaces.
> ---------------------------------------------------
>
>                 Key: PROTON-1184
>                 URL: https://issues.apache.org/jira/browse/PROTON-1184
>             Project: Qpid Proton
>          Issue Type: Improvement
>          Components: cpp-binding
>            Reporter: Alan Conway
>            Assignee: Alan Conway
>
> The new interface should be suitable for multi-threaded use, but provide similar ease-of-use to the existing container. All existing examples should work with minimal modification.
> It must be usable with C++03 but may provide a few added convenience functions with C++11.
> The default implementation will be single-threaded and based on the pn_reactor, with a multi-threaded example based on epoll.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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