No default branch
Bookmark a link to HEAD:
(view)
(download)
(as text)
Removed 'peak.running.timers' and 'peak.util.dispatch'. Neither was in active use, and both are being replaced by the new generic functions package in PyProtocols.
The 'events.IEventSource' interface now returns a 'canceller' function from the 'addCallback()' method, allowing you to cancel a previously- scheduled callback. This fixes a memory leak and performance problem with 'events.AnyOf()', which previously could accumulate unneeded callbacks on the sources it was monitoring. Note that if you have developed any custom event sources with 'addCallback()' methods, you must make sure that they return a canceller from now on.
Simplified activity timeout algorithm to a two-line loop with no arithmetic, using the standard 'peak.events' approach: an interesting example of converting callback-think into thread-think.
Big migration to 'peak.events': 'UntwistedReactor' and 'MainLoop' are now just facades over 'EventLoop'. Added untested Twisted support to implement 'peak.events' interfaces as facades over a reactor. Minor interface tweaks in 'peak.events' to cover the needs of real (and testable) event loops. Moved 'ifTwisted' and 'makeTwisted' to 'peak.events.api'. Ported 'TaskQueue' and 'FastCGIAcceptor' to use threads for scheduling. Por Other: fixed 'commands.AbstractInterpreter' failing with usage errors at construction time, rather than at use time. Refactored 'CGIInterpreter' to be an actual interpreter, and 'CGICommand' to not run an event loop unless FastCGI is being used. Also changed 'CGICommand' to perform setup at _run time rather than immediately upon assembly.
Lots of 'peak.events' migration: Added 'events.ISignalSource', that returns 'events.Broadcaster' objects for signals. This allows you to yield to signals in an 'events.Thread', or safely set one-time callbacks on them. 'running.ISignalManager' is now DEPRECATED; please use 'events.ISignalSource' instead. 'running.IMainLoop' has been changed to use an 'events.IReadable' for the 'lastActivity' attribute, and the 'setExitCode' and 'childForked' methods have been replaced with an 'exitWith()' method. The 'peak.running.mainLoop.signalHandler' property has been replaced with 'peak.running.mainLoop.stopOnSignals', which defaults to including SIGINT, SIGTERM, and SIGBREAK. If you need custom signal handling, please use the event sources provided by an 'events.ISignalSource'. 'peak.running.process.ChildProcess' has been rewritten to use 'events.ISignalSource' and an 'events.Thread' to monitor SIGCHLD. Removed 'checkStatus()' from the 'running.IProcessProxy' interface. Made most event sources weak-referenceable. Changed 'events.Thread' to keep a reference to an object it's yielding on, so that "weak" events like signals and I/O events will hang around until they call back to the thread.
Removed some more obsolete scheduling baggage.
Replaced scheduler of 'UntwistedReactor' with an 'events.Scheduler', so we can begin to use time-based events and threads in reactor-driven apps.
First pass of 'logs' framework refactoring. Highlights include: * Lots of new unit tests for logging. * Logs are now accessed via a 'logs.ILoggingService' instance. The 'logger:' URL scheme automatically accesses the nearest such service. For backward compatibility, the old 'peak.logs' namespace is still used to supply the actual loggers. This will be gradually replaced with a plugin-based mechanism. * Log events don't use a positional 'message' argument any more, and loggers aren't responsible for interpolating message arguments any more. The new signature is 'Event(parent, msg=msg, args=args, ...)'. Loggers also now tell events what logger name they are, via the 'ident' keyword. * The logging system now uses a property namespace, 'peak.logging.levels', to obtain log level names and values. The various 'logs.LEVEL' constants are now DEPRECATED. Please use the 'getLevelFor()' method of the nearest 'logs.ILoggingService' instead. URL schemes such as 'logfile:' also no longer convert their level names to numbers, since the level names are only meaningful in the context of a logging service. * Support for integration with the Python 2.3/PEP 282 logging module has been scaled back. There are too many globalisms and dependencies there. When we add plugin-based log configuration, it should be possible to use the logging package's handlers and formatters with the PEAK logging services. At that point, you'll be able to replace 'logging.getLogger' and 'logging.getLevelName' with the corresponding methods of a PEAK logging service, if you need to force non-PEAK packages to use PEAK's logging. * 'config.Namespace()' objects now have a 'keys()' method that can be used when the namespace is bound to a context component. It returns a list of strings that may be used as keys for that namespace. See 'CHANGES.txt' for an example.
Partial implementation of the performance timer system described at: http://www.eby-sarna.com/pipermail/peak/2003-December/001020.html It's missing the 'addListener()' function for the timer service, so you can only add listeners directly to individual timers. The actual interfaces are also a bit different than what was originally proposed. An exhaustive test suite is included, covering all of the implemented behavior. This draft implementation will probably get moved to Pyrex, at least to create a a Timer base class with fast-path execution for frequently called methods. The goal is to have timer invocation be so fast that leaving timers in production code isn't an issue. (TODO: 'addListener()' for keys/wildcards, 'timer:' URL scheme, and Pyrex port of Timer base.)
DEPRECATED 'peak.util.signal_stack'. Instead, bind to a 'running.ISignalManager' and use its 'addHandler()/removeHandler()' methods. This has the same effect as 'pushSignals()' and 'popSignals()', except that you do not have to remove handlers in the same order as you add them, and *all* active handlers are invoked for a given signal that they handle. Added 'IBasicReactor.crash()', which forces an immediate reactor loop exit, ignoring pending scheduled calls. This required changing some tests, because the precise moment of reactor termination is now different in some scheduling scenarios. Some changes were also made to task scheduling for CGI programs to account for this.
Merged 'Fallback' and 'PropertySet' to create 'config.Namespace'. Removed 'Fallback' and deprecated 'PropertySet'.
Removed all uses of deprecated binding APIs.
'peak.running.scheduler.MainLoop' now supports using a "signal manager" component (via the 'peak.running.signalManager' property) to process signals while a 'run()' loop is in progress. Signal managers can also be added or removed at any time via the new 'peak.util.signal_stack' module. Also, fixed scheduler tests using an app object without a config root.
Use propertyMap.setValue() instead of duplicating its implementation.
The 'provides' keyword argument to various 'peak.binding' APIs has been renamed to 'offerAs', and it must be a sequence of configuration keys. (Previously, it accepted either a single key or a tuple of keys.) The signature of 'binding.Constant()' was changed as well; the first positional argument is now the constant value, and 'offerAs' is now a keyword argument. (Previously, 'provides' was the first positional argument of 'binding.Constant()'.) The 'registerProvider()' method of 'config.IConfigurable()' also now accepts only a single configuration key, as does 'EigenRegistry.register()'.
Finished adding tests for daemons and schedulers.
More "root" cleanups. 'config.makeRoot()' can now take an 'iniFiles' argument listing file paths (or '(modulename,filename)' tuples) to load; it defaults to '[('peak','peak.ini')]', providing the default behavior we know and love. :) If you create a binding.Component with a parent of 'None', it will now believe you and make itself a root. The default value of parentComponent is now 'NOT_GIVEN', so that if you don't specify a parent, the object will be "undecided" until it really needs to know who its parent is (at which point it will be 'None' if it hasn't been "adopted" in the meantime). Interface docs and tests have been updated to reflect/take advantage of this. (Specifically, the tests used to use 'getParentComponent()' to force a root to acknowledge its orphan status; now they can just *tell* it.) Finally, I removed the use of weak references from the assembly events system. If you created an object, intending that it register itself with some kind of registry, it could get GC'd before the assembly event kicked in, unless you specifically held onto a reference until then. Since components that don't need assembly events don't register for them, it seems harmless to use simple references rather than weak ones.
Replaced 'config.Application' class with 'config.makeRoot()' function. (There's still a 'ConfigurationRoot' class behind the scenes, but it's no longer part of the public API.)
Added unit tests for daemons, reactor, and mainloop. Fixed a problem with missing 'priority' attribute on daemons.
Added [Load on demand] rules section, and made running.clusters use it. Also added basic unit tests for peak.running.clusters.
cvs-admin@eby-sarna.com Powered by ViewCVS 1.0-dev |
ViewCVS and CVS Help |