#9722: Use pyinotify (where available) instead of polling filesystem every 
second
to detect changes
---------------------------------------+------------------------------------
 Reporter:  lamby                      |       Owner:  nobody    
   Status:  new                        |   Milestone:            
Component:  django-admin.py runserver  |     Version:  1.0       
 Keywords:                             |       Stage:  Unreviewed
Has_patch:  1                          |  
---------------------------------------+------------------------------------
 This patch series adds support for pyinotify to replace the "poll-every-
 one-second" mechanism in django.utils.autoreload on systems where that
 library is available.

 Inotify is an event-driven notifier for monitoring filesytems changes.
 Instead of dancing around the filesystem comparing modification times
 every second, we can simply register all the files we are interested in
 and let the thread block until one of them changes. When this happens, we
 reload the server as before.

 This has the following advantages over the current polling system:

  * Scales far better to larger projects.
  * Response time to code changes is drastically reduced - the server
 restarts pretty much instantly instead of having to wait ~0.5 seconds for
 the reload.
  * More robust change detection - pretty much all forms of modification of
 the interested file are noticed (in particular, moving the file and
 editing the file without changing the mtime)
  * Saves battery usage - I have to use --noreload on my laptop (with
 encrypted filesystems) as it noticably reduces my battery life. Django is
 killing kittens.
  * Cleaner implementation - Polling is just dirty, and requires us to
 maintain a huge dict full of modification times.

 Whilst inotify is Linux-specific, the patch gracefully degrades if a
 suitable version of pyinotify is not available. It does not add pyinotify
 as a dependency to Django.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9722>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to