getOutputChunk() and markOutputAsReadyToSend() procedure.

Making & changing box plugins and external apps
Post Reply
glio
Posts: 10
Joined: Thu Mar 05, 2009 8:33 am
Location: Grenoble

getOutputChunk() and markOutputAsReadyToSend() procedure.

Post by glio »

Hello,

An other question to send data from a box. If I have not one, but many chunks to present at the output of the boxe, can I use the getOutputChunk() // markOutputAsReadyToSend() procedure sequentially - in the same box process ? Or I should send one chunk by call to the process() method of the boxe ?

Thank you,

Guillaume.

matthieuG
Posts: 54
Joined: Thu Nov 12, 2009 10:22 am
Location: grenoble

Re: getOutputChunk() and markOutputAsReadyToSend() procedure.

Post by matthieuG »

To fulfill what glio notice :
If getOutputChunk + markOutputAsReadyToSend is used many times in a box process, does the output is the last one (they overwrite) or does they fill a queue?
In case of queue, does markOutputAsReadyToSend should be send each time or only at the end of a box process?
In the case of overwriting, does appendOutputChunkData (with getOutputChunkBuffer) is enough?

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: getOutputChunk() and markOutputAsReadyToSend() procedure.

Post by yrenard »

Dear glio, dear matthieuG,

you can call the getOutputChunk / markOutputAsReadyToSend pair as many times as you want in a single process call. There is a queue so no data will be lost. As soon as you markOutputAsReadyToSend, the output chunk is taken by the kernel and a new empty chunk is ready to be filled as stated in the documentation page :
When called, the function flushes the output chunk. Thus, after the call, the chunk size is turned to 0 and the output is ready for a new chunk when necessary...
Hope this helps,
Best regards,
Yann

matthieuG
Posts: 54
Joined: Thu Nov 12, 2009 10:22 am
Location: grenoble

Re: getOutputChunk() and markOutputAsReadyToSend() procedure.

Post by matthieuG »

perfect, thanks!

glio
Posts: 10
Joined: Thu Mar 05, 2009 8:33 am
Location: Grenoble

Re: getOutputChunk() and markOutputAsReadyToSend() procedure.

Post by glio »

Thanks to !

Post Reply