All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.jetty.server.HttpInput_blocking.puml Maven / Gradle / Ivy

There is a newer version: 12.1.0.alpha0
Show newest version
@startuml
title "HttpInput"

participant AsyncContentDelivery as "[async\ncontent\ndelivery]"
participant HttpChannel as "Http\nChannel\n"
participant HttpChannelState as "Http\nChannel\nState"
participant AsyncContentProducer as "Async\nContent\nProducer"
participant Semaphore as "\nSemaphore\n"
participant BlockingContentProducer as "Blocking\nContent\nProducer"
participant HttpInput as "Http\nInput\n"
participant Application as "\nApplication\n"

autoactivate on

== Blocking Read ==

Application->HttpInput: read
activate Application
    HttpInput->BlockingContentProducer: nextContent
        loop
            BlockingContentProducer->AsyncContentProducer: nextContent
                AsyncContentProducer->AsyncContentProducer: nextTransformedContent
                    AsyncContentProducer->HttpChannel: produceContent
                    return
                return
                alt content is not null
                    AsyncContentProducer->HttpChannelState: onReadIdle
                    return
                end
            return content or null
            alt content is null
                BlockingContentProducer->HttpChannelState: onReadUnready
                return
                BlockingContentProducer->HttpChannel: needContent
                return
                alt needContent returns false
                    BlockingContentProducer->Semaphore: acquire
                    return
                else needContent returns true
                    note over BlockingContentProducer
                        continue loop
                    end note
                end
            else content is not null
                return non-null content
            end
        end
    ' return from BlockingContentProducer: nextContent
    HttpInput->HttpInput: copy content\ninto byte[]
    return
    alt content is empty
        HttpInput->BlockingContentProducer: reclaim
            BlockingContentProducer->AsyncContentProducer: reclaim
            return
        return
    end
return
deactivate Application

alt if content arrives
    AsyncContentDelivery->HttpInput: onContentProducible
        HttpInput->BlockingContentProducer: onContentProducible
            BlockingContentProducer->Semaphore: release
            return
        return false
    return false
end
@enduml




© 2015 - 2024 Weber Informatics LLC | Privacy Policy