Examples
The examples below show how to use the features discussed throughout this documentation:
-
cpp20_intro.cpp: Does not use awaitable operators.
-
cpp20_intro_tls.cpp: Communicates over TLS.
-
cpp20_unix_sockets.cpp: Communicates over UNIX domain sockets.
-
cpp20_containers.cpp: Shows how to send and receive STL containers and how to use transactions.
-
cpp20_json.cpp: Shows how to serialize types using Boost.Json.
-
cpp20_protobuf.cpp: Shows how to serialize types using protobuf.
-
cpp20_resolve_with_sentinel.cpp: Shows how to resolve a master address using sentinels.
-
cpp20_subscriber.cpp: Shows how to implement pubsub with reconnection re-subscription.
-
cpp20_echo_server.cpp: A simple TCP echo server.
-
cpp20_chat_room.cpp: A command line chat built on Redis pubsub.
-
cpp17_intro.cpp: Uses callbacks and requires C++17.
-
cpp17_intro_sync.cpp: Runs
async_runin a separate thread and performs synchronous calls toasync_exec. -
cpp17_spdlog.cpp: Shows how to use third-party logging libraries like
spdlogwith Boost.Redis.
The main function used in some async examples has been factored out in the main.cpp file.