[
https://issues.apache.org/jira/browse/DISPATCH-1099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16576446#comment-16576446
]
ASF GitHub Bot commented on DISPATCH-1099:
------------------------------------------
Github user ted-ross commented on a diff in the pull request:
https://github.com/apache/qpid-dispatch/pull/357#discussion_r209296711
--- Diff: src/router_core/core_timer.c ---
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "router_core_private.h"
+#include <stdio.h>
+
+qdr_timer_work_t *qdr_timer_schedule(qdr_core_t *core, qdr_timer_cb_t
callback, void *timer_context, int timer_delay)
+{
+ qdr_timer_work_t *timer_work = new_qdr_timer_work_t();
+ ZERO(timer_work);
+ timer_work->handler = callback;
+ timer_work->timer_delay = timer_delay;
+ timer_work->on_timer_context = timer_context;
+
+ DEQ_INSERT_TAIL(core->timer_list, timer_work);
--- End diff --
The timer algorithm should be reviewed, I think. This at-tail insertion
with absolute delay is going to be very inefficient if there are a large number
of timers (which is a probably scenario for cases where there are many
auto-links).
> Add a timer facility for the core thread
> ----------------------------------------
>
> Key: DISPATCH-1099
> URL: https://issues.apache.org/jira/browse/DISPATCH-1099
> Project: Qpid Dispatch
> Issue Type: Improvement
> Components: Container
> Affects Versions: 1.2.0
> Reporter: Ganesh Murthy
> Assignee: Ganesh Murthy
> Priority: Major
>
> Currently there is qd_router_timer_handler() in router_node.c which schedules
> a timer every second/ Extend this to send the timer action into core so core
> can execute some periodic actions.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]