Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #81398

Re: Recurring Task

From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: Recurring Task
Date 2014-11-23 13:35 -0500
Organization IISS Elusive Unicorn
References <4a496b58-867f-43ae-b6f9-48f4d885b170@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.16204.1416767724.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Sun, 23 Nov 2014 07:23:43 -0800 (PST), tim@timothyarnold.co.uk declaimed
the following:

>Hi All
>Looking for some advice. I'm creating a small netwok poller and wondered what people recommend to use? Will be polling up to 100 hosts every ten reconds or so
>

	That's only 10 per second -- presuming scattered access is allowed...
How much overhead is there in making the connection and transferring the
data? That is -- what is your worst case transaction time (account for
failure to connect time-outs).

	Since you're likely I/O bound, plain Python threads are probably
usable. You worst case analysis should indicate how many threads are
desirable (if 9 of the 10 per second take the full second, you likely want
10 and maybe a few extra threads).

	Trickiest part would be maintaining the time-ordered queue (has Python
created a priority queue yet? -- Ah, apparently it has -- so one could use
the desired clock value for the priority, and when the thread finishes it
requeues incrementing the clock value by the rescan interval... -- you'd
need to implement a sleep_until if the thread grabs an entry before its
time)
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Recurring Task tim@timothyarnold.co.uk - 2014-11-23 07:23 -0800
  Re: Recurring Task Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-11-23 13:35 -0500
  Re: Recurring Task Dan Stromberg <drsalists@gmail.com> - 2014-11-23 11:48 -0800
  Re: Recurring Task Dan Stromberg <drsalists@gmail.com> - 2014-11-23 11:56 -0800

csiph-web