Are there any more advanced examples/demos for autobahn/cpp?

Hi,

We just evaluate autobahn/cpp to use in an IoT demo. Thank you for the great protocol. We struggle a little bit how to setup the code nicely to be used and consumed by a developer.

The current examples, (https://github.com/crossbario/autobahn-cpp/blob/master/examples/) are too static for our use case.

So I wonder if there is (production/demo) code out there (e.g. github) where the WAMP initialization is ideally behind a nicely exposed API.

Thanks for looking into this.

/ jryannel

Hi,

We struggle a little bit how to setup the code nicely to be used and consumed by a developer.

not sure what you mean exactly.

AutobahnC++ is a headers only library, so there are no binaries to distribute, and a developer might just depend on a tagged release on GitHub.

That being said, we also have Docker images

https://hub.docker.com/r/crossbario/autobahn-cpp

which bundle a complete dev environment to build apps.

We also want to release the library on

https://conan.io/

eg pls see


where the WAMP initialization is ideally behind a nicely exposed API.

my view: well, the API

is as nice as it gets in C++;) what do mean here?

Cheers,
/Tobias

I guess exactly the last point. Using a header is not the difficulty, more using the API in a client application.
I understand due to C++ and futures the WAMP initialization (connect, session, joined) needs to be nested. I thought someone have come up with a easier to use (API wise) wrapper around this.

For example if the user wants to dynamically subscribe to topics, he can only register them after a joined. Ideally the user can register at any time, e.g. using an internal message queue, where requests are stored. Whent the client then goes online the queue is processed automatically.

Or a C++ client where I can register callbacks when session is joined, with the session as parameter. But maybe it’s just the way C++ works.

Just to be clear, I don’t expect wamp/c++ will offers this, I am looking more if there are larger examples/demos out there where they solved these problems already.

Cheers
/ jryannel

aah, ok, right.

fwiw, the way I look at it, an easier to digest syntax can be done using co-routines. at the time when autobahnc++ was originally created, that was still far in the future. pun;)

however, seems like co-routines are coming in c++20? eg https://devblogs.microsoft.com/oldnewthing/20191209-00/?p=103195

I havent had time yet to look into c++20 co-routines, but that might be added/enabled in autobahnc++ …

indeed: await has landed in c++20 https://en.cppreference.com/w/cpp/keyword/co_await