Results 1 to 8 of 8

Thread: background httprequests

  1. #1
    Join Date
    Feb 2012
    Posts
    6

    Default background httprequests

    is there documentation on the threading model of wowza? what is in its own thread and why?

    i'm asking because i need to initiate a background, non-blocking http request to interact w/ a RESTful API from within a module. i'm not sure if something like https://github.com/sonatype/async-http-client is going to be my best bet.

    one of my concerns is having my requests get lost in onAppStop, because that's from where I need to initiate one as well.

    I guess what I'm asking is am I OK to block in onAppStop, and wait for my existing requests to complete. is each connection on its own thread? is each application on its own thread? where can I find the answers to these questions?

    or just in general, what would be best practice to initiate non-blocking http requests from a wowza server-side module.

    thanks for your time and help,
    atypical

  2. #2
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Generally Wowza objects are thread safe and require no special handling (e.g. synchronized). One exception is where you are setting values in WMSProperties, that should be synchronized.

    Async HTTP calls in Wowza are not recommended, but doing something along those lines (non-blocking) is a good idea if you have to do it.

    Richard

  3. #3
    Join Date
    Feb 2012
    Posts
    6

    Default

    so I could block in onAppStop and it wouldn't cause any harmful side-effects? (at which point I could make sure my pending async requests are processed or timed out, etc.)

  4. #4
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    No, you misunderstood. To be clear, http calls are not recommended, it can definitely cause problems.

    Richard

  5. #5
    Join Date
    Feb 2012
    Posts
    6

    Default

    what would you suggest for some reliable pushable RPC then?

    we just need a reliable dual channel communication between our wowza module and our web stack.

    edit: also, what's changed since http://www.wowza.com/forums/showthre...-HTTP-requests ?
    Last edited by atypical; 05-07-2012 at 05:32 PM.

  6. #6
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    You can do it, but it can cause problems. Try to minimize, avoid, mitigate every way you can. Direct JDBC calls should be better, if you are not waiting for result set.

    Richard

  7. #7
    Join Date
    Aug 2011
    Posts
    8

    Default

    Sorry to jump in here; but which way do you suggest then to notify other systems of certain events, e.g. client connect/disconnect?

    JMX notifications aren't supported either, are they?

    What problems do you expect regarding fire-and-forget HTTP requests?

    Steffen

  8. #8
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Steffen,

    If done carefully, it could be okay. You don't want async http calls all over the place in the middle of every client session.

    Richard

Similar Threads

  1. Live Audio Streaming: Background Noise/Disturbance
    By Jaskaran81 in forum General Forum
    Replies: 4
    Last Post: 11-19-2012, 11:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •