Record Class QueueOptions
java.lang.Object
java.lang.Record
org.mineskin.QueueOptions
- Record Components:
scheduler- Executor service to run the queue - this should be a single-threaded schedulerintervalMillis- Interval in milliseconds between each requestconcurrency- Maximum number of concurrent requests
- All Implemented Interfaces:
IQueueOptions
public record QueueOptions(ScheduledExecutorService scheduler, int intervalMillis, int concurrency)
extends Record
implements IQueueOptions
-
Constructor Summary
ConstructorsConstructorDescriptionQueueOptions(ScheduledExecutorService scheduler, int intervalMillis, int concurrency) Creates an instance of aQueueOptionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theconcurrencyrecord component.static AutoGenerateQueueOptionsDeprecated.static AutoGenerateQueueOptionscreateAutoGenerate(ScheduledExecutorService scheduler) Deprecated.static QueueOptionsDeprecated.static QueueOptionscreateGenerate(ScheduledExecutorService scheduler) Deprecated.static QueueOptionsDeprecated.static QueueOptionscreateGet(ScheduledExecutorService scheduler) Deprecated.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of theintervalMillisrecord component.Returns the value of theschedulerrecord component.final StringtoString()Returns a string representation of this record class.withConcurrency(int concurrency) withInterval(int interval, TimeUnit unit) Methods inherited from interface IQueueOptions
reportFailure
-
Constructor Details
-
QueueOptions
Creates an instance of aQueueOptionsrecord class.- Parameters:
scheduler- the value for theschedulerrecord componentintervalMillis- the value for theintervalMillisrecord componentconcurrency- the value for theconcurrencyrecord component
-
-
Method Details
-
createGenerate
Deprecated.Creates a QueueOptions instance with default values for generate requests (200ms interval, 1 concurrent request). -
createGenerate
Deprecated.Creates a QueueOptions instance with default values for generate requests (200ms interval, 1 concurrent request). -
createAutoGenerate
@Deprecated public static AutoGenerateQueueOptions createAutoGenerate(ScheduledExecutorService scheduler) Deprecated.Creates a QueueOptions instance that automatically adjusts the interval and concurrency based on the user's allowance.- See Also:
-
createAutoGenerate
Deprecated.Creates a QueueOptions instance that automatically adjusts the interval and concurrency based on the user's allowance.- See Also:
-
createGet
Deprecated.Creates a QueueOptions instance with default values for get requests (100ms interval, 5 concurrent requests). -
createGet
Deprecated.Creates a QueueOptions instance with default values for get requests (100ms interval, 5 concurrent requests). -
withInterval
-
withConcurrency
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
scheduler
Returns the value of theschedulerrecord component.- Specified by:
schedulerin interfaceIQueueOptions- Returns:
- the value of the
schedulerrecord component
-
intervalMillis
public int intervalMillis()Returns the value of theintervalMillisrecord component.- Specified by:
intervalMillisin interfaceIQueueOptions- Returns:
- the value of the
intervalMillisrecord component
-
concurrency
public int concurrency()Returns the value of theconcurrencyrecord component.- Specified by:
concurrencyin interfaceIQueueOptions- Returns:
- the value of the
concurrencyrecord component
-
GenerateQueueOptions.createAuto()