Re: Discouraging use of sync APIs



On Mon, Feb 09, 2015 at 11:14:46AM +0000, Philip Withnall wrote:
On Mon, 2015-02-09 at 10:57 +0000, Debarshi Ray wrote:
One convention that I like is to use a _sync suffix for sync APIs,
instead of an _async suffix for async ones, because it lets me spot
synchronous calls with grep.

A little sad that there are things like g_file_read that are sync, not
async.

We had a brief discussion about that at the DX hackfest, and I think the
consensus was that the current naming scheme (no suffix = sync, ?_async?
suffix = async) is unfortunate, but has to be kept for consistency
reasons. It would be really confusing to switch to a new scheme while
keeping the old one. :-(

There is really no consistency at the moment. eg., see
g_dbus_proxy_new and the code generated by gdbus-codegen. It differs
from class to class and module to module.

We can't break API, so atleast for future additions it would be good
to use a better convention.

Cheers,
Debarshi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]