<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>Hi Palanikumar, looks like you've got a typo there, it's <b>send_interval</b> not <b>sent_interval</b>:</div><div><br></div><div><blockquote type="cite"><div dir="ltr"><font color="#000000"><span style="background-color: rgba(255, 255, 255, 0);">call to undefined function timer:sent_interval(1000, <<"Time announcement from erlang server">>) </span></font></div></blockquote></div><div><br></div><div>On 23 Sep 2017, at 13:34, Palanikumar Gopalakrishnan <<a href="mailto:palani@vahaitech.com">palani@vahaitech.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div>Hi Guys,<br></div>                I tried with<b> timer:send_interval/2 </b>, and <b>timer:send _interval/3  </b>also . see my trial and error result . Both them returns<br><br><br>17:54:47.250 [error] CRASH REPORT Process <0.575.0> with 0 neighbours crashed with reason: call to undefined function timer:sent_interval(1000, <<"Time announcement from erlang server">>)<br>17:54:47.250 [error] Ranch listener my_cowboy_ws_server terminated with reason: call to undefined function timer:sent_interval(1000, <<"Time announcement from erlang server">>) <br><br><br>     17:59:06.678 [error] CRASH REPORT Process <0.570.0> with 0 neighbours crashed with reason: call to undefined function timer:sent_interval(1000, <0.570.0>, "Time announcement from erlang server")<br>17:59:06.678 [error] Ranch listener my_cowboy_ws_server terminated with reason: call to undefined function timer:sent_interval(1000, <0.570.0>, "Time announcement from erlang server")<br><br><br><div>           <br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 23 September 2017 at 17:00, Igor Clark <span dir="ltr"><<a href="mailto:igor.clark@gmail.com" target="_blank">igor.clark@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <tt>Hi again Palanikumar, check the error message - you're still
      calling timer:apply_interval instead of timer:send_interval,
      except now you're only passing 2 arguments:<br>
      <br>
    </tt><tt><span class=""><tt><b>call to undefined function
          timer:apply_interval(1000, "Time announcement from erlang
          server")</b></tt><tt><br>
      </tt><br></span>
      Be careful to check the signatures of the functions you're calling
      and the argument lists you're providing. This is just basic error
      checking ;-)<br>
      <br>
      NB, please hit "reply to all" in future rather than just "reply",
      as you'll include the mailing list, and other people will be able
      to help too.<br>
      <br>
      Cheers<span class="HOEnZb"><font color="#888888"><br>
      i<br>
    </font></span></tt><div><div class="h5"><br>
    <div class="m_7421751256653615869moz-cite-prefix">On 23/09/2017 12:07, Palanikumar
      Gopalakrishnan wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div>
          <div>Hi lgor,<br>
            <br>
          </div>
                       I tried with <b>timer:send_interval/2 with this
            line<br>
             >>> timer:apply_interval(1000,  "Time announcement
            from erlang server"),</b><br>
          <br>
            returns the following error<br>
          <br>
          <b>16:33:20.264 [error] CRASH REPORT Process <0.570.0>
            with 0 neighbours crashed with reason: call to undefined
            function timer:apply_interval(1000, "Time announcement from
            erlang server")<br>
            16:33:20.265 [error] Ranch listener my_cowboy_ws_server
            terminated with reason: call to undefined function
            timer:apply_interval(1000, "Time announcement from erlang
            server")<br>
            <br>
            <br>
          </b></div>
        same as <b>timer:send_interval/3 </b>throw the error<br>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On 23 September 2017 at 16:24, Igor
          Clark <span dir="ltr"><<a href="mailto:igor.clark@gmail.com" target="_blank">igor.clark@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF"> You could try <tt><a href="http://erlang.org/doc/man/timer.html#send_interval-3" target="_blank">timer:send_interval/3</a>:</tt><br>
              <br>
              <blockquote type="cite"><tt>send_interval(Time, Pid,
                  Message)</tt><br>
                Evaluates <tt>Pid</tt> ! <tt>Message</tt> repeatedly
                after <tt>Time</tt> milliseconds. (<tt>Pid</tt> can
                also be an atom of a registered name.)<br>
              </blockquote>
              <br>
              There's even a <a href="http://erlang.org/doc/man/timer.html#send_interval-2" target="_blank"><tt>timer:send_interval/2</tt></a>
              that assumes <tt>self()</tt> as the <tt>Pid</tt>, which
              looks like it might be what you want<tt>:</tt><br>
              <br>
              <blockquote type="cite"><tt>send_interval(Time, Message)</tt><br>
                Same as <tt>send_interval(Time, self(), Message)</tt>.</blockquote>
              <br>
              One thing to note though is that the <a href="http://erlang.org/doc/efficiency_guide/commoncaveats.html#id60818" target="_blank">Common Caveats</a>
              section says:<br>
              <br>
              <blockquote type="cite">
                <p style="max-width:42em;color:rgb(26,26,26);font-family:sans-serif;font-size:16px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Creating
                  timers using<span class="m_7421751256653615869m_333471933988590179Apple-converted-space"> </span><span class="m_7421751256653615869m_333471933988590179bold_code m_7421751256653615869m_333471933988590179bc-13" style="font-family:mono,Courier,monospace;font-weight:bold"><a href="http://erlang.org/doc/man/erlang.html#erlang:send_after-3" style="color:rgb(27,110,194);text-decoration:none" target="_blank">erlang:send_after/3</a></span><span class="m_7421751256653615869m_333471933988590179Apple-converted-space"> </span>and<span class="m_7421751256653615869m_333471933988590179Apple-converted-space"> </span><span class="m_7421751256653615869m_333471933988590179bold_code m_7421751256653615869m_333471933988590179bc-13" style="font-family:mono,Courier,monospace;font-weight:bold"><a href="http://erlang.org/doc/man/erlang.html#erlang:start_timer-3" style="color:rgb(27,110,194);text-decoration:none" target="_blank"><wbr>erlang:start_timer/3</a></span><span class="m_7421751256653615869m_333471933988590179Apple-converted-space"> </span>,
                  is much more efficient than using the timers provided
                  by the<span class="m_7421751256653615869m_333471933988590179Apple-converted-space"> </span><span class="m_7421751256653615869m_333471933988590179bold_code m_7421751256653615869m_333471933988590179bc-18" style="font-family:mono,Courier,monospace;font-weight:bold"><a href="http://erlang.org/doc/man/timer.html" style="color:rgb(27,110,194);text-decoration:none" target="_blank">timer</a></span><span class="m_7421751256653615869m_333471933988590179Apple-converted-space"> </span>module
                  in STDLIB. The<span class="m_7421751256653615869m_333471933988590179Apple-converted-space"> </span><span class="m_7421751256653615869m_333471933988590179code" style="font-family:mono,Courier,monospace;font-weight:normal;background-color:rgb(243,243,243)">timer</span>module
                  uses a separate process to manage the timers. That
                  process can easily become overloaded if many processes
                  create and cancel timers frequently (especially when
                  using the SMP emulator).</p>
              </blockquote>
              <br>
              I'm not sure if that applies to send_interval/{2,3} as
              well, or quite how many "many" means there - I guess it's
              probably "a really large number", but perhaps somebody
              could jump in here?<br>
              <br>
              But if so, and if you expect heavy traffic with an
              interval like this on every WS connection, an alternative
              might be to create a loop to send the message using <tt>send_after/3</tt>
              instead of using the <tt>timer</tt> module. I.e. the
              process which handles <tt>Msg</tt> could call <tt>erlang:send_after(
                Time, self(), Msg )</tt> when it's done its other work.
              Working out which process does that would depend on your
              app design - it might work to just do it in the process
              which handles the message you're sending, or you might
              need another process.<br>
              <br>
              Cheers<span class="m_7421751256653615869HOEnZb"><font color="#888888"><br>
                  i</font></span>
              <div>
                <div class="m_7421751256653615869h5"><br>
                  <br>
                  <br>
                  <div class="m_7421751256653615869m_333471933988590179moz-cite-prefix">On
                    23/09/2017 11:21, Palanikumar Gopalakrishnan wrote:<br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">
                      <div>Hi lgor Clark,<br>
                      </div>
                                             Thanks for the help.  yes
                      you  are correct. Its there any way to send
                      message to websocket using <b>timer:apply_interval/4</b>.
                      I didn't find any examples. <br>
                      <br>
                      <br>
                      <br>
                    </div>
                    <div class="gmail_extra"><br>
                      <div class="gmail_quote">On 23 September 2017 at
                        15:47, Igor Clark <span dir="ltr"><<a href="mailto:igor.clark@gmail.com" target="_blank">igor.clark@gmail.com</a>></span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                          <div text="#000000" bgcolor="#FFFFFF"> Hi
                            Palanikumar,<br>
                            <br>
                            It looks like you're passing the <tt><a href="http://erlang.org/doc/man/erlang.html#start_timer-3" target="_blank">erlang:start_timer/3</a></tt>
                            arguments to <tt><a href="http://erlang.org/doc/man/timer.html#apply_interval-4" target="_blank">timer:apply_interval/4</a></tt>:<br>
                            <br>
                                <tt>erlang:start_timer(Time, Dest, Msg)</tt><br>
                            <br>
                            vs<br>
                            <br>
                                <tt>apply_interval(Time, Module,
                              Function, Arguments)</tt><br>
                            <br>
                            <tt>erlang:start_timer/3</tt> sends <tt>Msg</tt>
                            to <tt>Dest</tt> after <tt>Time</tt> ms; <tt>timer:apply_interval/4</tt>
                            calls <tt>Module:Function(Arguments)</tt>
                            every <tt>Time</tt> ms.<br>
                            <br>
                            So the error message is telling you that the
                            function <tt>timer:apply_interval/3</tt>
                            you're trying to call doesn't exist.<br>
                            <br>
                            HTH,<br>
                            Igor
                            <div>
                              <div class="m_7421751256653615869m_333471933988590179h5"><br>
                                <br>
                                <div class="m_7421751256653615869m_333471933988590179m_6431617450298307261moz-cite-prefix">On
                                  23/09/2017 10:50, Palanikumar
                                  Gopalakrishnan wrote:<br>
                                </div>
                              </div>
                            </div>
                            <blockquote type="cite">
                              <div>
                                <div class="m_7421751256653615869m_333471933988590179h5">
                                  <div dir="ltr">
                                    <div>
                                      <div>
                                        <div>
                                          <div>
                                            <div>
                                              <div>Hi Guys,<br>
                                                <br>
                                              </div>
                                                           I want  to
                                              send  message to the
                                              front-end via websocket in
                                              particular time interval.<br>
                                            </div>
                                            So i use timer module for
                                            this purpose.<br>
                                             <b>timer:apply_interval(1000,
                                              self(), <<"How' you
                                              doin'?">>),</b></div>
                                          <div><b><br>
                                            </b></div>
                                          <div><b><br>
                                            </b></div>
                                          But it returns the following
                                          error<br>
                                          <br>
                                          <b>15:18:20.558 [error] CRASH
                                            REPORT Process
                                            <0.570.0> with 0
                                            neighbours crashed with
                                            reason: call to undefined
                                            function
                                            timer:apply_interval(6000,
                                            <0.570.0>,
                                            <<"How' you
                                            doin'?">>)<br>
                                            15:18:20.558 [error] Ranch
                                            listener my_cowboy_ws_server
                                            terminated with reason: call
                                            to undefined function
                                            timer:apply_interval(6000,
                                            <0.570.0>,
                                            <<"How' you
                                            doin'?">>)<br>
                                            <br>
                                            <br>
                                          </b></div>
                                        Its there any way to solve this
                                        problem. <br>
                                        <br>
                                      </div>
                                      I already tried with <br>
                                      <br>
                                      <b>erlang:start_timer(60000,
                                        self(), <<"How' you
                                        doin'?">>)<br>
                                        <br>
                                      </b></div>
                                    Its only send message after
                                    particular timer. I didn't found
                                    method in this module to send
                                    message in particular interval.<br>
                                    <br>
                                    <br>
                                    <br>
                                    <div>
                                      <div><br>
                                        <div><br>
                                          <br>
                                          <div>
                                            <div>
                                              <div>
                                                <div><br>
                                                  <br>
                                                  <div>
                                                    <div>           <br clear="all">
                                                      <div><br>
                                                        -- <br>
                                                        <div class="m_7421751256653615869m_333471933988590179m_6431617450298307261gmail_signature">
                                                          <div dir="ltr">
                                                          <div>
                                                          <div dir="ltr">
                                                          <div>
                                                          <div dir="ltr">
                                                          <div>
                                                          <div dir="ltr">
                                                          <div>
                                                          <div><br>
                                                          </div>
                                                          <div><b>Warm
                                                          Regards,</b></div>
                                                          </div>
                                                          <div><br>
                                                          </div>
                                                          <div><span style="background-color:rgb(255,255,255)"><span style="font-size:12.8px"><b>Palanikumar Gopalakrishnan </b></span></span><img alt="✌" style="font-size:small;margin:0px 0.2ex;vertical-align:middle;height:24px;width:24px" src="cid:"><span style="background-color:rgb(255,255,255)"><br>
                                                          </span></div>
                                                          <div><span style="font-size:12.8px;background-color:rgb(255,255,255)"><b>Developer</b></span><br>
                                                          </div>
                                                          <div><br>
                                                          </div>
                                                          <div><br>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                        </div>
                                                      </div>
                                                    </div>
                                                  </div>
                                                </div>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                  <br>
                                  <fieldset class="m_7421751256653615869m_333471933988590179m_6431617450298307261mimeAttachmentHeader"></fieldset>
                                  <br>
                                </div>
                              </div>
                              <pre>______________________________<wbr>_________________
erlang-questions mailing list
<a class="m_7421751256653615869m_333471933988590179m_6431617450298307261moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a>
<a class="m_7421751256653615869m_333471933988590179m_6431617450298307261moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/list<wbr>info/erlang-questions</a>
</pre>
                            </blockquote>
                            <br>
                          </div>
                        </blockquote>
                      </div>
                      <br>
                      <br clear="all">
                      <br>
                      -- <br>
                      <div class="m_7421751256653615869m_333471933988590179gmail_signature" data-smartmail="gmail_signature">
                        <div dir="ltr">
                          <div>
                            <div dir="ltr">
                              <div>
                                <div dir="ltr">
                                  <div>
                                    <div dir="ltr">
                                      <div>
                                        <div><br>
                                        </div>
                                        <div><b>Warm Regards,</b></div>
                                      </div>
                                      <div><br>
                                      </div>
                                      <div><span style="background-color:rgb(255,255,255)"><span style="font-size:12.8px"><b>Palanikumar
                                              Gopalakrishnan </b></span></span><img alt="✌" style="font-size:small;margin:0px 0.2ex;vertical-align:middle;height:24px;width:24px" src="cid:"><span style="background-color:rgb(255,255,255)"><br>
                                        </span></div>
                                      <div><span style="font-size:12.8px;background-color:rgb(255,255,255)"><b>Developer</b></span><br>
                                      </div>
                                      <div><br>
                                      </div>
                                      <div><br>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <br>
        -- <br>
        <div class="m_7421751256653615869gmail_signature" data-smartmail="gmail_signature">
          <div dir="ltr">
            <div>
              <div dir="ltr">
                <div>
                  <div dir="ltr">
                    <div>
                      <div dir="ltr">
                        <div>
                          <div><br>
                          </div>
                          <div><b>Warm Regards,</b></div>
                        </div>
                        <div><br>
                        </div>
                        <div><span style="background-color:rgb(255,255,255)"><span style="font-size:12.8px"><b>Palanikumar
                                Gopalakrishnan </b></span></span><img alt="✌" style="font-size:small;margin:0px 0.2ex;vertical-align:middle;height:24px;width:24px" src="cid:"><span style="background-color:rgb(255,255,255)"><br>
                          </span></div>
                        <div><span style="font-size:12.8px;background-color:rgb(255,255,255)"><b>Developer</b></span><br>
                        </div>
                        <div><br>
                        </div>
                        <div><br>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </div></div></div>

</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><br></div><div><b>Warm Regards,</b></div></div><div><br></div><div><span style="background-color:rgb(255,255,255)"><span style="font-size:12.8px"><b>Palanikumar Gopalakrishnan </b></span></span><img src="https://ssl.gstatic.com/mail/emoji/6/48px/emoji_u270c.png" alt="✌" style="font-size:small;margin:0px 0.2ex;vertical-align:middle;height:24px;width:24px"><span style="background-color:rgb(255,255,255)"><br></span></div><div><span style="font-size:12.8px;background-color:rgb(255,255,255)"><b>Developer</b></span><br></div><div><br></div><div><br></div></div></div></div></div></div></div></div></div>
</div>
</div></blockquote></body></html>