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 TypeMethodDescriptionvoidEmitted when a request is queued onsession.default MemorySegmenttoCallback(Arena arena) Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)method.default voidupcall(MemorySegment sourceSession, MemorySegment msg) Theupcallmethod is called from native code.
-
Method Details
-
run
Emitted when a request is queued onsession.When sending a request, first
Session::request-queuedis emitted, indicating that the session has become aware of the request.After a connection is available to send the request various
Messagesignals are emitted as the message is processed. If the message is requeued, it will emitMessage::restarted, which will then be followed by otherMessagesignals 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-unqueuedto indicate that it is done with the message.To sum up:
Session::request-queuedandSession::request-unqueuedare guaranteed to be emitted exactly once, butMessage::finished(and all of the otherMessagesignals) may be invoked multiple times for a given message. -
upcall
Theupcallmethod 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:
toCallbackin interfaceFunctionPointer- Parameters:
arena- the arena in which the function pointer is allocated- Returns:
- the native function pointer
-