Passing messages to App Connect during processing of API action

Don't have a direct need for this but something i have thought about in the past.
I often have lengthy API actions involving multiple steps.
I know we have status' such as executing and processing within app connect but is there a way to pass "progress messages" back to app connect during the processing of an API action.
Something like being able to pass "Stage 1 Complete", "Stage 2 Complete" etc

At present i would simply split into separate actions and "chain" them based on completion of each return of success in the previous action but was looking at other ideas.
Perhaps sockets could be used to pass status messages back to App Connect? Certainly that is the recommended method via Google AI.
Any alternative ideas?
More just me vocalising my thoughts rather than a genuine need but thought i would put it out there as a discussion point.

Sockets are the way to go:

Thanks Teodor, have it working, was really simple thanks.
Guess that is the best way after all.

1 Like

interestingly, if you place an emit as the very first action in the server action, it doesn't seem to be sent.
This works

With this, the first emit is not sent