Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: AnyEvent timers by EV

by Krambambuli (Curate)
on Apr 04, 2015 at 14:26 UTC ( #1122410=note: print w/replies, xml ) Need Help??


in reply to Re^2: AnyEvent timers by EV
in thread AnyEvent timers by EV

Most probably ->now_update clears the internal 'cache' entirely, so the persistence is swapped away.

There is no *timer* timeout because in the example code the timeout is set to 300 seconds - a long time after every action is over. There are however *connection* timeouts - most probably the server closes connections that are idle for seconds, and you are keeping them idle by sleeping 5 seconds between the calls.

That's what's happening, in sequence:

1) successful GET; try to keep connection alive
2) enter sleep
3) server closes connection
4) get awake and try a GET; failure. Clear connection cache
5) sleep
6) go to 1)

Krambambuli
---

Replies are listed 'Best First'.
Re^4: AnyEvent timers by EV
by Anonymous Monk on Apr 05, 2015 at 11:30 UTC
    300 sec timer is unnecessary
    Im intersting only on 2s timer for request
    My guess how it should work is:
    1) try to GET with timeout 2s (timer set to internal time + 2sec, but internal time has lag 5s)
    2) update internal time at ->recv.
    3) fire timeout for GET, because internal time now = real time, and timer+2s is now in the past
    4) throw error about timeout...
    But... maybe before check timeout for connection it already has success status for GET and timeout at this situation is dropped away
      It was me. Sorry, lost login )

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1122410]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2019-12-07 01:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (160 votes). Check out past polls.

    Notices?