#include #include #include namespace MR = myx::redis; class RedisClient : public QObject { Q_OBJECT public: explicit RedisClient( MR::PubSub* p, QObject* o = nullptr ) : QObject( o ) { p->subscribe( "test", this, "readChannelTest" ); } private: Q_INVOKABLE void readChannelTest( const QString& channel, const QByteArray& message ) { qDebug() << channel; qDebug() << message; if ( message == "quit" ) { qCritical() << message; qApp->quit(); } } }; // class RedisClient