Conversation
|
Please fix travis-ci first, put |
chenshuo
left a comment
There was a problem hiding this comment.
I haven't read the contrib/mariadhclient/ part, will do it later.
| Channel(EventLoop* loop, int fd); | ||
| typedef std::function<void(int, Timestamp)> EventsCallback; | ||
|
|
||
| Channel(EventLoop* loop, int fd, bool classify = true); |
There was a problem hiding this comment.
I suggest not to introduce the new classify parameter. Instead, if EventsCallback is provided, it intercepts all events.
There was a problem hiding this comment.
Do you mean change
channel_->setEventsCallback(std::bind(&MariaDBClient::stateMachineHandler, this, kRealConnectCont, _1, 2));
to
channel->setReadCallback(std::bind(&MariaDBClient::stateMachineHandler, this, kRealConnectCont, _1, 2));
channel->setWriteCallback(std::bind(&MariaDBClient::stateMachineHandler, this, kRealConnectCont, _1, _2));
?
| bool isWriting() const { return events_ & kWriteEvent; } | ||
| bool isReading() const { return events_ & kReadEvent; } | ||
|
|
||
| void enableEvents(int events__) { events_ = events__; update(); } |
There was a problem hiding this comment.
on centos7-x86_64:
if events__ -> events
错误:‘events’的声明隐藏了‘this’的一个成员 [-Werror=shadow]
events shadows int events()
ref:
Channel::Channel(EventLoop* loop, int fd__, bool classify)
|
Update:
Test successfully with MariaDB-Server/MySQL-Server ref: |
MariaDB Async Client
Using Non-blocking API
Reference:
https://mariadb.com/kb/en/using-the-non-blocking-library/
https://github.com/MariaDB/server/blob/5.5/client/async_example.c
https://github.com/MariaDB/server/blob/5.5/tests/async_queries.c
https://mariadb.com/kb/en/non-blocking-api-reference/
Build:
centos7-x86_64:
yum install mariadb-devel mariadb-libs
ubuntu14.04-x86_64:
apt-get install libmariadbclient-dev
ln -sf libmariadbclient.so libmysqlclient.so