Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9000977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:22:37+00:00 2026-06-16T00:22:37+00:00

I have a Java-based Bukkit plugin (fairly irrelevant to the issue at hand but

  • 0

I have a Java-based Bukkit plugin (fairly irrelevant to the issue at hand but noteworthy) that will, every 30 minutes, query a web API for updates to pass on to users.

Here is the existing method, which works fine to pass every user to the API:

public ApiMessenger()
{        
    TASK_ID = Bukkit.getScheduler().scheduleAsyncRepeatingTask(plugin,new Runnable()
    {
        @Override
        public void run()
        {
            if(Bukkit.getOnlinePlayers().length > 0)
            {
                ApiMessenger.fetchPlayerItems(Bukkit.getOnlinePlayers(),true);
            }
        }
    }, 20*60*30, 20*60*30);
}

However the API will accept, at most, 30 users at a time.

So any server using this plugin that has more than 30 users on at a time will not be able to submit all their users at once, because the rest will be ignored.

What I’m trying to figure out is what kind of setup would allow me to store all the users with some form of a timestamp so that the ApiMessenger method shown above can remember which users have been sent and attempt to send the ones who have been waiting the longest for an update first.

I can manage removing/adding users as they join/leave, but my main concern is first creating a sorted data structure that can be updated as the groups of 30 users are sent.

Unfortunately I don’t know which data types in Java to use to create such a structure that can be iterated in an ascending fashion.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:22:37+00:00Added an answer on June 16, 2026 at 12:22 am

    Have you considered using a queue? You can read up on it in Java here. When a player logs on, simply add them to the queue of players to be processed. Then, simply pop 30 items off the list and process them. You can get then just simply push these users to the back of the queue.
    If a player logs off, you can remove them from the queue or do a check to see if they’re online at the time of processing the queue. If I understand correctly – this should get you on the way to solving your issue!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have inherited an application (Java-based, running on WebLogic 10.3.5) that makes extensive use
I have a java based application that manipulates a mysql database. I would like
My next university project is going to be Java based. We will have to
We have an existing java-based heavyweight project that needed an interactive script interpreter. After
Context: The Cloud We have a java-based web application that we normally host on
i need to implement this scenario Brief about that is have two java based
I have a SWT based Java application that works on Windows, Mac OS and
I have been working with a 3rd party java based REST webservice, that returns
i have a java based desktop app that i am hoping to rewrite as
I have a WCF web service that returns a string to a Java based

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.