something like this may work but I never tried

from gluon.streamer import streamer

def mystreamer(stream):
    # log start of streaming
    for bytes in streamer(stream):
        yield bytes
    # log end of streaming

On Nov 21, 4:40 am, Ishbir <[email protected]> wrote:
> Hey there,
>
> So what I want is that a function/line of code should execute AFTER a
> controller function has thrown out all the output.
>
> What I have is a download function; I'm trying to keep track of open/
> closed connections. Users would be downloading big files; like
> 200-400MB. So, I want to know how many connections have been opened by
> the user and how many of them have been closed.
>
> What the script does is, it fetches a file from the remote server; and
> streams it back to the client. I'm using a custom streaming function
> which calls the response.stream function in the end after sending out
> the necessary headers/fetching the file from the remote server.
>
> Possible or do I need to implement the response.stream function on my
> own?

Reply via email to