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


Groups > comp.lang.python > #81400

Re: Recurring Task

References <4a496b58-867f-43ae-b6f9-48f4d885b170@googlegroups.com> <0f947a1upejmd3376lbj7h33ejdsgv9msl@4ax.com>
Date 2014-11-23 11:56 -0800
Subject Re: Recurring Task
From Dan Stromberg <drsalists@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.16206.1416772625.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Sun, Nov 23, 2014 at 10:35 AM, Dennis Lee Bieber
<wlfraed@ix.netcom.com> wrote:
> 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
>>
>
>         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)

The standard library way: https://docs.python.org/3/library/queue.html
Here's another way - a class I ported from Java:
https://pypi.python.org/pypi/fibonacci-heap-mod

The Fibonacci Heap is theoretically nice because it's lazy and
supports some interesting operations like O(1) merge and O(1)
decrease-key, but it has a large constant on its O(logn) dequeue-min.

Back to comp.lang.python | Previous | Next — Previous 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