Package io.netty.util.internal
Class PendingWrite
- java.lang.Object
-
- io.netty.util.internal.PendingWrite
-
public final class PendingWrite extends java.lang.Object
Some pending write which should be picked up later.
-
-
Field Summary
Fields Modifier and Type Field Description private ObjectPool.Handle<PendingWrite>
handle
private java.lang.Object
msg
private Promise<java.lang.Void>
promise
private static ObjectPool<PendingWrite>
RECYCLER
-
Constructor Summary
Constructors Modifier Constructor Description private
PendingWrite(ObjectPool.Handle<PendingWrite> handle)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
failAndRecycle(java.lang.Throwable cause)
Fails the underlyingPromise
with the given cause and recycle this instance.java.lang.Object
msg()
static PendingWrite
newInstance(java.lang.Object msg, Promise<java.lang.Void> promise)
Create a new emptyRecyclableArrayList
instancePromise<java.lang.Void>
promise()
boolean
recycle()
Clear and recycle this instance.Promise<java.lang.Void>
recycleAndGet()
Recycle this instance and return thePromise
.boolean
successAndRecycle()
Mark the underlyingPromise
successfully and recycle this instance.
-
-
-
Field Detail
-
RECYCLER
private static final ObjectPool<PendingWrite> RECYCLER
-
handle
private final ObjectPool.Handle<PendingWrite> handle
-
msg
private java.lang.Object msg
-
promise
private Promise<java.lang.Void> promise
-
-
Constructor Detail
-
PendingWrite
private PendingWrite(ObjectPool.Handle<PendingWrite> handle)
-
-
Method Detail
-
newInstance
public static PendingWrite newInstance(java.lang.Object msg, Promise<java.lang.Void> promise)
Create a new emptyRecyclableArrayList
instance
-
recycle
public boolean recycle()
Clear and recycle this instance.
-
failAndRecycle
public boolean failAndRecycle(java.lang.Throwable cause)
Fails the underlyingPromise
with the given cause and recycle this instance.
-
successAndRecycle
public boolean successAndRecycle()
Mark the underlyingPromise
successfully and recycle this instance.
-
msg
public java.lang.Object msg()
-
promise
public Promise<java.lang.Void> promise()
-
-