<div>Hi Michael,</div>
<div> </div>
<div>The following code was executed once, but not after the next 10 s. </div>
<div> </div>
<div>SWITCH_STANDARD_SCHED_FUNC(data_flush_callback) {</div>
<div>switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "starting to flush data buffer...\n");<br> </div>
<div> task->runtime = switch_time_now() + 10;</div>
<div>}</div>
<div><br>Any suggestion why?</div>
<div> </div>
<div> </div>
<div>Thanks,</div>
<div>Mark<br></div>
<div class="gmail_quote">On Sat, Aug 15, 2009 at 2:13 AM, Michael Jerris <span dir="ltr"><<a href="mailto:mike@jerris.com">mike@jerris.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div style="WORD-WRAP: break-word">thats in seconds.
<div><br></div>
<div>Mike</div>
<div>
<div></div>
<div class="h5">
<div><br>
<div>
<div>On Aug 14, 2009, at 8:32 AM, mark morreny wrote:</div><br>
<blockquote type="cite">
<div>Hi,</div>
<div> </div>
<div>Thank you for your help. </div>
<div> </div>
<div>I get that too, but the callback does not execute the second time. </div>
<div> </div>
<div>When I do task->runtime = switch_time_now() + 10;, what does +10 mean? Does it mean 10 s or 10 mins?</div>
<div> </div>
<div>Thanks,</div>
<div>Mark<br><br></div>
<div class="gmail_quote">On Wed, Aug 12, 2009 at 11:09 PM, Mathieu Rene <span dir="ltr"><<a href="mailto:mrene_lists@avgs.ca" target="_blank">mrene_lists@avgs.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div style="WORD-WRAP: break-word">Hi,
<div><br></div>
<div>I did the same thing on my side....
<div><br></div>
<div>
<div>API CALL [load(mod_skel)] output:</div>
<div>+OK</div>
<div><br></div>
<div>2009-08-12 11:08:18.37891 [DEBUG] switch_scheduler.c:214 Added task 2 data_flush (core) to run at 1250089698</div>
<div>2009-08-12 11:08:18.37891 [CONSOLE] switch_loadable_module.c:889 Successfully Loaded [mod_skel]</div>
<div>2009-08-12 11:08:18.37891 [NOTICE] switch_loadable_module.c:270 Adding API Function 'skel'</div>
<div><a href="mailto:freeswitch@Maths-Mac.local" target="_blank">freeswitch@Maths-Mac.local</a>> 2009-08-12 11:08:18.207113 [ERR] mod_skel.c:120 starting to flush data buffer...</div>
<div><br></div>
<div>Note that you don't need to start the thread manually, the core already has threads running for the scheduler.</div>
<div><br></div><font color="#888888">
<div>
<div style="WORD-WRAP: break-word">
<div><span style="FONT-SIZE: 12px">
<div>Mathieu Rene</div>
<div>Avant-Garde Solutions Inc</div>
<div>Office: + 1 (514) 664-1044 x100</div>
<div>Cell: +1 (514) 664-1044 x200</div>
<div><a href="mailto:mrene@avgs.ca" target="_blank">mrene@avgs.ca</a></div>
<div><br></div>
<div><br></div></span></div></div><br></div></font>
<div>
<div></div>
<div><br>
<div>
<div>On 12-Aug-09, at 7:26 AM, mark morreny wrote:</div><br>
<blockquote type="cite">Hi,<br><br>In my LOAD_FUNCTION, I am trying to have freeswitch to flush out some data every 10 s. The following lines of code does not show any effect at all.<br><br> switch_scheduler_task_thread_start();<br>
switch_scheduler_add_task(switch_epoch_time_now(NULL), data_flush_callback, "data_flush","core",0,NULL,SSHF_NONE|SSHF_NO_DEL);<br><br><br>SWITCH_STANDARD_SCHED_FUNC(data_flush_callback) {<br><br>switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "starting to flush data buffer...\n");<br>
<br><br> task->runtime = switch_time_now() + 10;<br><br>}<br><br>Does anyone know how to get it to work?<br><br>Thanks,<br>Mark<br><br><br>
<div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Brian West</b> <span dir="ltr"><<a href="mailto:brian@freeswitch.org" target="_blank">brian@freeswitch.org</a>></span><br>
Date: Mon, Aug 10, 2009 at 8:53 PM<br>Subject: Re: [Freeswitch-users] Fwd: Scheduler in module<br>To: <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br><br>
<br>switch_rtp.c has a simple one for the zrtp cache storing.<br><font color="#888888"><br>/b<br></font>
<div><br>On Aug 10, 2009, at 7:13 AM, Michael Jerris wrote:<br><br>> Re schedule is done in your callback, take a look at places that use<br>> these apis in the code for details.<br></div></div></blockquote></div></div>
</div></div></div></div></blockquote></div></blockquote></div><br></div></div></div></div><br>_______________________________________________<br>FreeSWITCH-users mailing list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br><br></blockquote></div><br>