Interface Session.RequestQueuedCallback
- All Superinterfaces:
FunctionPointer
- Enclosing class:
Session
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
RequestQueuedCallback
callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Emitted when a request is queued onsession
.default MemorySegment
toCallback
(Arena arena) Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.default void
upcall
(MemorySegment sourceSession, MemorySegment msg) Theupcall
method is called from native code.
-
Method Details
-
run
Emitted when a request is queued onsession
.When sending a request, first
Session::request-queued
is emitted, indicating that the session has become aware of the request.After a connection is available to send the request various
Message
signals are emitted as the message is processed. If the message is requeued, it will emitMessage::restarted
, which will then be followed by otherMessage
signals when the message is re-sent.Eventually, the message will emit
Message::finished
. Normally, this signals the completion of message processing. However, it is possible that the application will requeue the message from the "finished" handler. In that case the process will loop back.Eventually, a message will reach "finished" and not be requeued. At that point, the session will emit
Session::request-unqueued
to indicate that it is done with the message.To sum up:
Session::request-queued
andSession::request-unqueued
are guaranteed to be emitted exactly once, butMessage::finished
(and all of the otherMessage
signals) may be invoked multiple times for a given message. -
upcall
Theupcall
method is called from native code. The parameters are marshaled andrun(org.gnome.soup.Message)
is executed. -
toCallback
Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.- Specified by:
toCallback
in interfaceFunctionPointer
- Parameters:
arena
- the function pointer will be allocated in this arena- Returns:
- the native function pointer
-