So I did:
uwsgi.wait_read_hook = uwsgi_simple_wait_read_hook;

and it also works, however implementing the Qt loop async
is a must, as the programer can easily create a local loop
with QEvenLoop and have the socket notifier to get another
request which fails to process here, what should be done?

Many thanks,

2014-07-11 1:18 GMT-03:00 Roberto De Ioris <[email protected]>:
>
>> So I thought the wait_read_hook would have a default
>> implementation if I didn't overwrite it's function pointer,
>> so far I have added this:
>>
>> static int cutelyst_wait_fd_read(int fd, int timeout) {
>>     qDebug() << Q_FUNC_INFO;
>>     QAbstractSocket *sock = new
>> QAbstractSocket(QAbstractSocket::TcpSocket, qApp);
>>     sock->setSocketDescriptor(fd);
>>     sock->waitForReadyRead(timeout)
>>     qDebug() << Q_FUNC_INFO << sock->bytesAvailable();
>>     return sock->bytesAvailable();
>> }
>>
>> and it works, however this is far from optimal.
>>
>> Is the fd always an TcpSocket?
>> Since the fd is always the same (at least here),
>> wouldn't be better to use the socket notifier
>> on the req->fd?
>>
>> Thanks
>>
>
> Your implementation should be added for sure in the qtloop plugin (feel
> free to make a pull request even for the write and sleep hooks), but as
> you said, it should fallback to the default implementation (the poll-based
> one)
>
> The default hooks are initialized in init.c:
>
> uwsgi.wait_read_hook = uwsgi_simple_wait_read_hook;
> uwsgi.wait_write_hook = uwsgi_simple_wait_write_hook;
> uwsgi.wait_milliseconds_hook = uwsgi_simple_wait_milliseconds_hook;
> uwsgi.wait_read2_hook = uwsgi_simple_wait_read2_hook;
>
>
> --
> Roberto De Ioris
> http://unbit.it
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi



-- 
Daniel Nicoletti

KDE Developer - http://dantti.wordpress.com
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to