[PEAK] New Trellis features in SVN

Phillip J. Eby pje at telecommunity.com
Fri Jul 27 19:10:44 EDT 2007


At 04:51 PM 7/26/2007 -0400, Phillip J. Eby wrote:
>Features planned, but not yet in SVN are:
>
>* ``.force_recalc()`` method for implementing hub-and-spoke rules
>   (see http://www.eby-sarna.com/pipermail/peak/2007-July/002750.html )

This is now implemented as the ``.ensure_recalculation()`` method of 
cell objects.


>* ``todo`` and ``future`` attributes
>   (see http://www.eby-sarna.com/pipermail/peak/2007-July/002752.html )

This is implemented, with a slight modification.  Any method that 
accesses "future" attributes must be marked with a 
``@trellis.modifier`` decorator, so the ``add()`` and ``remove()`` 
attributes in the ``Set`` example linked above should be so decorated.

As it turned out, this is needed to ensure that things work properly 
if you call methods like these from outside a Trellis rule.


>* ``poll()`` and ``volatile()``
>   (support for rules that run "in the background")

I ended up implementing ``poll()`` and ``repeat()``.  If you call 
``poll()`` in a rule, then the rule will be recalculated the next 
time *any* cell is set, anywhere.  More precisely, it will be 
recalculated during the next pulse, which will occur after the 
current pulse if anything is set during the current pulse.

The ``repeat()`` rule is similar, except that it also ensures that 
there *will* be another pulse.  Which means it can cause an infinite 
loop.  (By contrast, ``poll()`` will only cause recalculation when 
there is something else "happening" in the program.


>* ``values()``, ``receivers()``, ``todos()``
>   (reinstate plural forms, as I found them annoying to live without)
>
>* ``.set_value(v)`` and ``.get_value()`` methods for cell objects
>   (for convenience in setting up callbacks from other systems)
>
>* Remove dependency on the unreleased "Contextual" package
>   (we're currently only using one exception class from there, and
>   the features that will require it in future will be in either the
>   "TrellisIO" or "TrellisDB" packages; more details below)

Done, done, and done.


This leaves only the following features to be completed before release:

>* ``task``, ``Pause``, ``Return``, ``resume()``, and ``TaskCell``
>   (support for pseudothreads similar to ``peak.events.Task``)
>
>* Basic ``Set``, ``List``, and ``Dict`` data structure types, with
>   cells that describe their current changes
>
>* Reference manual + brief developer's guide/tutorial

Please let me know if you have any questions or run into any issues.




More information about the PEAK mailing list