You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by Jasen Kim <ir...@gmail.com> on 2023/03/28 13:55:17 UTC

Rivet HTTP stream server-side

Hello,

I ran into an issue trying to implement an http stream between client and
server.

I want to be able to send the http output in chunks rather than buffering
and outputting all at once.

Is there any way to accomplish this in Apache Rivet without having to hack
it?

Thanks,
Jasen

Re: Rivet HTTP stream server-side

Posted by Jasen Kim <ir...@gmail.com>.
Thank you Massimo. The solution was quite simple and worked as intended.

On Tue, Mar 28, 2023 at 12:50 PM Jasen Kim <ir...@gmail.com> wrote:

> Hi Massimo,
>
> Thank you for the quick response. This is exactly the solution I was
> thinking of but did not know how to execute it.
>
> I will try implementing your solution and let you know my results.
>
> Thanks,
> Jasen
>
> On Tue, Mar 28, 2023 at 12:43 PM Massimo Manghi <ma...@unipr.it>
> wrote:
>
>> Hi Jasen
>>
>>
>> the RivetChan behaves like stdout and actually replaces stdout for the
>> Tcl interpreters embedded in mod_rivet. You can have control over the
>> buffering using
>>
>> puts -nonewline $output_buffer
>>
>> to store in the channel buffer your data and the send it calling
>>
>> flush stdout
>>
>> in this way you can for example send binary data in chunks of definite
>> size. Since RivetChan is just a Tcl I/O channel you have to configure it
>> with -translation binary which sets also the encoding to binary. Let us
>> know if it answers your question
>>
>>
>>   -- Massimo
>>
>>
>> On 28/03/23 15:55, Jasen Kim wrote:
>> > Hello,
>> >
>> > I ran into an issue trying to implement an http stream between client
>> > and server.
>> >
>> > I want to be able to send the http output in chunks rather than
>> > buffering and outputting all at once.
>> >
>> > Is there any way to accomplish this in Apache Rivet without having to
>> > hack it?
>> >
>> > Thanks,
>> > Jasen
>>
>

Re: Rivet HTTP stream server-side

Posted by Jasen Kim <ir...@gmail.com>.
Hi Massimo,

Thank you for the quick response. This is exactly the solution I was
thinking of but did not know how to execute it.

I will try implementing your solution and let you know my results.

Thanks,
Jasen

On Tue, Mar 28, 2023 at 12:43 PM Massimo Manghi <ma...@unipr.it>
wrote:

> Hi Jasen
>
>
> the RivetChan behaves like stdout and actually replaces stdout for the
> Tcl interpreters embedded in mod_rivet. You can have control over the
> buffering using
>
> puts -nonewline $output_buffer
>
> to store in the channel buffer your data and the send it calling
>
> flush stdout
>
> in this way you can for example send binary data in chunks of definite
> size. Since RivetChan is just a Tcl I/O channel you have to configure it
> with -translation binary which sets also the encoding to binary. Let us
> know if it answers your question
>
>
>   -- Massimo
>
>
> On 28/03/23 15:55, Jasen Kim wrote:
> > Hello,
> >
> > I ran into an issue trying to implement an http stream between client
> > and server.
> >
> > I want to be able to send the http output in chunks rather than
> > buffering and outputting all at once.
> >
> > Is there any way to accomplish this in Apache Rivet without having to
> > hack it?
> >
> > Thanks,
> > Jasen
>

Re: Rivet HTTP stream server-side

Posted by Massimo Manghi <ma...@unipr.it>.
Hi Jasen


the RivetChan behaves like stdout and actually replaces stdout for the 
Tcl interpreters embedded in mod_rivet. You can have control over the 
buffering using

puts -nonewline $output_buffer

to store in the channel buffer your data and the send it calling

flush stdout

in this way you can for example send binary data in chunks of definite 
size. Since RivetChan is just a Tcl I/O channel you have to configure it 
with -translation binary which sets also the encoding to binary. Let us 
know if it answers your question


  -- Massimo


On 28/03/23 15:55, Jasen Kim wrote:
> Hello,
> 
> I ran into an issue trying to implement an http stream between client 
> and server.
> 
> I want to be able to send the http output in chunks rather than 
> buffering and outputting all at once.
> 
> Is there any way to accomplish this in Apache Rivet without having to 
> hack it?
> 
> Thanks,
> Jasen

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org