Life cycle of stream resources

Discussion in 'Developers Corner' started by jbernardis, Nov 16, 2011.

  1. jbernardis

    jbernardis Active Member

    1,077
    0
    Oct 21, 2003
    Princeton NJ
    When using a stream resource resource under PYHME, what is its status once the stream has finished playing.

    I assume the object still exists in memory, but it's essentially useless. The only thing I should probably do with it is to destroy it. If I want to play a subsequent stream, I need to reinstantiate a new object. Is this correct? Is there a protocol to follow to properly destroy the object, or will GC clean it up correctly?

    One thing I noted. When I am debugging, I often run pyhme in the foreground just so I can see its standard output. I can break out of it easily enough (on my linux-based NAS) with a simple Ctrl-C. However, once I use a stream resource (at least I THINK that's the cause) the Ctrl-C causes the process to hang - I see the message that says "Server Exits", but I never get my prompt back. I have to open up a new window and do a kill -9.

    Can you think of anything I might be doing wrong here. I don't have a real application yet - I am just building up pieces. Right now I just play the stream and react to the play and pause buttons. To exit, I need to press live-tv (or the TiVo button). Maybe this is the issue. As I asked above, maybe there's some protocol to cleaning up the stream resource that will solve this issue - at least I'm hoping the solution is that easy.
     

Share This Page