Class SocialPoller

java.lang.Object
com.mcawful.social.SocialPoller

public final class SocialPoller extends Object
Polls every SocialPlatform for new activity and fires the social events

A poll type is polled when chat, Discord or repost rewards want it. Uses these keys in the platform's table:

  • poll_<type>: announce new items of the type in chat (true/false)
  • polldelay_<type>: seconds between polls, never less than SocialPollType.minDelaySeconds()
  • reward_toggle: also poll the types that feed repost rewards
  • lastpoll_<type>: when the type was last polled, in epoch seconds
  • watermark_<type>: where the next poll starts
  • watermarkaccount_<type>: the account the watermark belongs to
  • last_<type>: the newest announced item, as JSON
and these in discordSettings, for platform bluesky and poll type mentions:
  • blueskyToggle: Discord announcements are on
  • blueskyAnnounceMentions: announce new items of the type in Discord
The first poll of a type only records a watermark, so turning a poll on never announces old activity. The same happens when the linked account has changed, and when the type has not been polled for STALE_POLLS delays (at least STALE_SECONDS), so activity from while it was off is not announced or rewarded.
Author:
mcawful
  • Method Details

    • instance

      public static SocialPoller instance()
      Returns the instance, starting the poller on first use
      Returns:
      the instance
    • kill

      public void kill()
      Stops polling