where can I find a working example of using execSqlAsync (Postgres) in Drogon?
The short code snippets provided on the official Drogon website do not compile.
execSqlAsyncFuture instead if you want to make inside your function before the callback,
hi, i am currently trying to use a Websocket controller along with a pubsubservice so i paid a close attention to the websocket chat example provided in the repos, but unfortunately it doesn't really cover my usecase. indeed the chat showed as example works in "closed loop" where incoming messages get forwarded back to the other subscribers of the room. what i want to achieve is to use an inmem data container (say a vector) coming from another part of my program and use its content to publish data to subscribers. So my question is what would be the best pattern to achieve this ? What would be the most elegant way for my WebSocketController to obtain the reference of my std::vector and stream its content ? thank you.
you could store the vector in websocket controller.
using RecvMessageCallback = std::function< void(const TcpConnectionPtr &, MsgBuffer *)>
TcpConnectionPtr->getRecvBuffer()to read and/or write?
Where do I put code for dragon to do some custom automation for the following? :
Client from website presses a button to read some data from the local PostgreSQL database.
Dragon will listen for requests using websockets.
Then dragon will parse the JSON data that was requested from client.
Dragon needs to know what this parsed JSON data request means.
Parsed JSON data says to fetch some data from local PostgreSQL database.
After dragon fetches data from local PostgreSQL database, dragon needs to send this fetched data to the client using websocket.
The above can be easily done using node.js But how can the above objectives be done using dragon?
Are there any tutorials other than WiKi and docsforge?
I find WiKi and docsforge a bit too advanced and complicated for a beginner to understand.