Needs more work, but several experiments that make things more responsive under load.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3783 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-01-22 20:13:14 +00:00
parent 0f03701043
commit b2a552b3e0
9 changed files with 128 additions and 100 deletions

View File

@ -173,32 +173,6 @@ static void _tf_ssb_sqlStream_callback(JSValue row, void* user_data)
JSValue response = JS_Call(info->context, info->callback, JS_UNDEFINED, 1, &row);
tf_util_report_error(info->context, response);
JS_FreeValue(info->context, response);
if (tf_task_get(info->context))
{
tf_task_run_jobs(tf_task_get(info->context));
}
else
{
JSRuntime* runtime = JS_GetRuntime(info->context);
while (JS_IsJobPending(runtime))
{
JSContext* context = NULL;
int r = JS_ExecutePendingJob(runtime, &context);
if (context)
{
JSValue result = JS_GetException(context);
tf_util_report_error(context, result);
}
if (r < 0)
{
js_std_dump_error(context);
}
else if (r == 0)
{
break;
}
}
}
}
static JSValue _tf_ssb_sqlStream(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv)
@ -257,10 +231,6 @@ static JSValue _tf_ssb_storeMessage(JSContext* context, JSValueConst this_val, i
{
tf_ssb_notify_message_added(ssb, id);
}
else
{
printf("failed to store message\n");
}
}
else
{