<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Timer on sillysky.net</title>
    <link>https://sillysky.net/docs/nyssr/timer/</link>
    <description>Recent content in Timer on sillysky.net</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Wed, 15 Oct 2025 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://sillysky.net/docs/nyssr/timer/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>CTimer</title>
      <link>https://sillysky.net/docs/nyssr/timer/ctimer/</link>
      <pubDate>Wed, 15 Oct 2025 00:00:00 +0000</pubDate>
      <guid>https://sillysky.net/docs/nyssr/timer/ctimer/</guid>
      <description>&lt;p&gt;The &lt;code&gt;CTimer&lt;/code&gt; class is a helper class for using timers.&lt;/p&gt;&#xA;&lt;h2 id=&#34;constructor&#34;&gt;Constructor&lt;/h2&gt;&#xA;&lt;p&gt;The constructor expects the same arguments as the method to start a timer,&#xA;plus the reference to the &lt;a href=&#34;https://sillysky.net/docs/nyssr/timer/itimermanager/&#34;&gt;timer manager&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;These are&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a record ID to identify the message&lt;/li&gt;&#xA;&lt;li&gt;a target address for which target the message is to be received&lt;/li&gt;&#xA;&lt;li&gt;a timeout in milliseconds (when does the message arrive)&lt;/li&gt;&#xA;&lt;li&gt;a flag whether the message should be repeated&lt;/li&gt;&#xA;&lt;li&gt;an optional record for payload data&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre class=&#34;ss-javacode&#34;&gt;&lt;code class=&#34;language-java&#34;&gt;public &lt;a href=&#34;https://sillysky.net/docs/nyssr/timer/ctimer/&#34;&gt;CTimer&lt;/a&gt;(@NotNull final &lt;a href=&#34;https://sillysky.net/docs/nyssr/timer/itimermanager/&#34;&gt;ITimerManager&lt;/a&gt; aManager,&#xA;              @NotNull final &lt;a href=&#34;https://sillysky.net/docs/nyssr/ids-and-addresses/id/&#34;&gt;IId&lt;/a&gt; aId,&#xA;              @NotNull final &lt;a href=&#34;https://sillysky.net/docs/nyssr/ids-and-addresses/ctargetaddress/&#34;&gt;CTargetAddress&lt;/a&gt; aAddress,&#xA;              final long aDelay,&#xA;              final boolean aRepeat,&#xA;              @Nullable final &lt;a href=&#34;https://sillysky.net/docs/nyssr/messages/crecord/&#34;&gt;CRecord&lt;/a&gt; aTemplate)&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This does not start the timer yet, it only saves the timer data.&lt;/p&gt;</description>
    </item>
    <item>
      <title>ITimerManager</title>
      <link>https://sillysky.net/docs/nyssr/timer/itimermanager/</link>
      <pubDate>Wed, 15 Oct 2025 00:00:00 +0000</pubDate>
      <guid>https://sillysky.net/docs/nyssr/timer/itimermanager/</guid>
      <description>&lt;p&gt;The timer manager takes care of the management of the current timers. Timers&#xA;in nyssr.net are messages that are sent to their target after a certain time.&lt;/p&gt;&#xA;&lt;h2 id=&#34;get-the-timer-manager&#34;&gt;Get the timer manager&lt;/h2&gt;&#xA;&lt;p&gt;The manager is fetched as a singleton from the &lt;a href=&#34;https://sillysky.net/docs/nyssr/services/serviceregistry/&#34;&gt;service registry&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;pre class=&#34;ss-javacode&#34;&gt;&lt;code class=&#34;language-java&#34;&gt;final &lt;a href=&#34;https://sillysky.net/docs/nyssr/timer/itimermanager/&#34;&gt;ITimerManager&lt;/a&gt; tm = &lt;a href=&#34;https://sillysky.net/docs/nyssr/services/serviceregistry/&#34;&gt;CServiceRegistry&lt;/a&gt;.getInstance()&#xA;                                         .getService(&lt;a href=&#34;https://sillysky.net/docs/nyssr/timer/itimermanager/&#34;&gt;ITimerManager&lt;/a&gt;.class);&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As always, make sure that the &lt;a href=&#34;https://sillysky.net/docs/nyssr/services/iservicestarter/&#34;&gt;service starter&lt;/a&gt; of your package has a&#xA;dependency on the &lt;code&gt;ITimerManager&lt;/code&gt; to ensure that the service already exists.&lt;/p&gt;&#xA;&lt;h2 id=&#34;start-a-timer&#34;&gt;Start a timer&lt;/h2&gt;&#xA;&lt;p&gt;One way to start a timer is to use the corresponding methods of the timer&#xA;manager directly. The method requires&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
