gboolean
dispatch_async(TrgClient * tc, JsonNode * req,
               GSourceFunc callback, gpointer data)
{
    trg_request *trg_req = g_new0(trg_request, 1);
    trg_req->node = req;

    return dispatch_async_common(tc, trg_req, callback, data);
}
gboolean async_http_request(TrgClient *tc, gchar *url, const gchar *cookie, GSourceFunc callback, gpointer data) {
	trg_request *trg_req = g_new0(trg_request, 1);
	trg_req->url = g_strdup(url);

	if (cookie)
		trg_req->cookie = g_strdup(cookie);

	return dispatch_async_common(tc, trg_req, callback, data);
}
gboolean
dispatch_async_str(TrgClient * tc, gchar * req,
                   GSourceFunc callback, gpointer data)
{
    trg_request *trg_req = g_new0(trg_request, 1);
    trg_req->str = req;

    return dispatch_async_common(tc, trg_req, callback, data);
}