Interface AsyncQueueWriter<L>

    • Method Detail

      • canWrite

        @Deprecated
        boolean canWrite​(Connection<L> connection,
                         int size)
        Deprecated.
        the size parameter will be ignored, use Writer.canWrite(org.glassfish.grizzly.Connection) instead.
        Parameters:
        connection - the Connection to test whether or not the specified number of bytes can be written to.
        size - number of bytes to write.
        Returns:
        true if the queue has not exceeded it's maximum size in bytes of pending writes, otherwise false
        Since:
        2.2
      • notifyWritePossible

        @Deprecated
        void notifyWritePossible​(Connection<L> connection,
                                 WriteHandler writeHandler,
                                 int size)
        Deprecated.
        the size parameter will be ignored, use instead.
        Registers WriteHandler, which will be notified ones the Connection is able to accept more bytes to be written. Note: using this method from different threads simultaneously may lead to quick situation changes, so at time WriteHandler is called - the queue may become busy again.
        Parameters:
        connection - Connection
        writeHandler - WriteHandler to be notified.
        size - number of bytes queue has to be able to accept before notifying WriteHandler.
        Since:
        2.2
      • setMaxPendingBytesPerConnection

        void setMaxPendingBytesPerConnection​(int maxQueuedWrites)
        Configures the maximum number of bytes pending to be written for a particular Connection.
        Parameters:
        maxQueuedWrites - maximum number of bytes that may be pending to be written to a particular Connection.
      • getMaxPendingBytesPerConnection

        int getMaxPendingBytesPerConnection()
        Returns:
        the maximum number of bytes that may be pending to be written to a particular Connection. By default, this will be four times the size of the Socket send buffer size.
      • isAllowDirectWrite

        boolean isAllowDirectWrite()
        Returns true, if async write queue is allowed to write buffer directly during write(...) method call, w/o adding buffer to the queue, or false otherwise.
        Returns:
        true, if async write queue is allowed to write buffer directly during write(...) method call, w/o adding buffer to the queue, or false otherwise.
      • setAllowDirectWrite

        void setAllowDirectWrite​(boolean isAllowDirectWrite)
        Set true, if async write queue is allowed to write buffer directly during write(...) method call, w/o adding buffer to the queue, or false otherwise.
        Parameters:
        isAllowDirectWrite - true, if async write queue is allowed to write buffer directly during write(...) method call, w/o adding buffer to the queue, or false otherwise.