Home / Type/ QpackDecoderStateSyncStrategy Type — netty Architecture

QpackDecoderStateSyncStrategy Type — netty Architecture

Architecture documentation for the QpackDecoderStateSyncStrategy type/interface in QpackDecoderStateSyncStrategy.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  dd3ba072_fae9_3934_ad3e_2ca10f0e1a28["QpackDecoderStateSyncStrategy"]
  bb8b108b_f7d6_edbd_1f0a_d7e9aa6f711d["QpackDecoderStateSyncStrategy.java"]
  dd3ba072_fae9_3934_ad3e_2ca10f0e1a28 -->|defined in| bb8b108b_f7d6_edbd_1f0a_d7e9aa6f711d
  style dd3ba072_fae9_3934_ad3e_2ca10f0e1a28 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http3/src/main/java/io/netty/handler/codec/http3/QpackDecoderStateSyncStrategy.java lines 24–75

public interface QpackDecoderStateSyncStrategy {

    /**
     * Callback when an <a
     * href="https://www.rfc-editor.org/rfc/rfc9204.html#name-encoded-field-section-prefi">
     * encoded header field section</a> is decoded successfully by the decoder.
     *
     * @param requiredInsertCount for the encoded field section.
     */
    void sectionAcknowledged(int requiredInsertCount);

    /**
     * When a header field entry is added to the decoder dynamic table.
     *
     * @param insertCount for the entry.
     * @return {@code true} if an <a
     * href="https://www.rfc-editor.org/rfc/rfc9204.html#name-insert-count-increment">insert count
     * increment decoder instruction</a> should be sent.
     */
    boolean entryAdded(int insertCount);

    /**
     * Returns a {@link QpackDecoderStateSyncStrategy} that will acknowledge each entry added via
     * {@link #entryAdded(int)} unless a prior {@link #sectionAcknowledged(int)} call has implicitly acknowledged the
     * addition.
     *
     * @return A {@link QpackDecoderStateSyncStrategy} that will acknowledge each entry added via
     * {@link #entryAdded(int)} unless a prior {@link #sectionAcknowledged(int)} call has implicitly acknowledged the
     * addition.
     */
    static QpackDecoderStateSyncStrategy ackEachInsert() {
        return new QpackDecoderStateSyncStrategy() {
            private int lastCountAcknowledged;

            @Override
            public void sectionAcknowledged(int requiredInsertCount) {
                if (lastCountAcknowledged < requiredInsertCount) {
                    lastCountAcknowledged = requiredInsertCount;
                }
            }

            @Override
            public boolean entryAdded(int insertCount) {
                if (lastCountAcknowledged < insertCount) {
                    lastCountAcknowledged = insertCount;
                    return true;
                }
                return false;
            }
        };
    }
}

Frequently Asked Questions

What is the QpackDecoderStateSyncStrategy type?
QpackDecoderStateSyncStrategy is a type/interface in the netty codebase, defined in codec-http3/src/main/java/io/netty/handler/codec/http3/QpackDecoderStateSyncStrategy.java.
Where is QpackDecoderStateSyncStrategy defined?
QpackDecoderStateSyncStrategy is defined in codec-http3/src/main/java/io/netty/handler/codec/http3/QpackDecoderStateSyncStrategy.java at line 24.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free