Package com.jsgalactic.axiom.execution
Record Class StreamPolicy
java.lang.Object
java.lang.Record
com.jsgalactic.axiom.execution.StreamPolicy
- Record Components:
maxActive- maximum number of concurrently active streams
Immutable bound on the streams that may run at the same time. Each stream holds one slot from the
moment its response head is accepted until its body ends, is cancelled or is cut by shutdown. The
bound is separate from request admission: a stream leaves its request slot when it becomes a
stream, so open streams cannot take capacity away from ordinary requests. An aggregate bound
applies to every listener or test client, and a route override narrows it for that route. A new
stream is refused with 503 when either bound is full, before any stream bytes are written.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxActiverecord component.static StreamPolicyreject(int maxActive) Configures immediate refusal when the active limit is occupied.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
StreamPolicy
public StreamPolicy(int maxActive) Validates the bound before it can be installed.- Parameters:
maxActive- positive active limit- Throws:
IllegalArgumentException- if the limit is not positive
-
-
Method Details
-
reject
Configures immediate refusal when the active limit is occupied.- Parameters:
maxActive- positive active limit- Returns:
- policy that refuses a new stream with 503 when all slots are taken
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. All components in this record class are compared with '=='. -
maxActive
public int maxActive()Returns the value of themaxActiverecord component.- Returns:
- the value of the
maxActiverecord component
-