{ "info": { "author": "Phillip J. Eby", "author_email": "peak@eby-sarna.com", "bugtrack_url": null, "classifiers": [], "description": "(NOTE: As of 0.7a1, many new features have been added to the Trellis API,\nand some old ones have been deprecated. If you are upgrading from an older\nversion, please see the `porting guide`_ for details.)\n\nWhether it's an application server or a desktop application, any sufficiently\ncomplex system is event-driven -- and that usually means callbacks.\n\nUnfortunately, explicit callback management is to event-driven programming what\nexplicit memory management is to most other kinds of programming: a tedious\nhassle and a significant source of unnecessary bugs.\n\nFor example, even in a single-threaded program, callbacks can create race\nconditions, if the callbacks are fired in an unexpected order. If a piece\nof code can cause callbacks to be fired \"in the middle of something\", both that\ncode *and* the callbacks can get confused.\n\nOf course, that's why most GUI libraries and other large event-driven systems\nusually have some way for you to temporarily block callbacks from happening.\nThis lets you fix or workaround your callback order dependency bugs... at the\ncost of adding even *more* tedious callback management. And it still doesn't\nfix the problem of forgetting to cancel callbacks... or register needed ones\nin the first place!\n\nThe Trellis solves all of these problems by introducing *automatic* callback\nmanagement, in much the same way that Python does automatic memory management.\nInstead of worrying about subscribing or \"listening\" to events and managing\nthe order of callbacks, you just write rules to compute values. The Trellis\n\"sees\" what values your rules access, and thus knows what rules may need to be\nrerun when something changes -- not unlike the operation of a spreadsheet.\n\nBut even more important, it also ensures that callbacks *can't* happen while\ncode is \"in the middle of something\". Any action a rule takes that would cause\na new event to fire is *automatically* deferred until all of the applicable\nrules have had a chance to respond to the event(s) in progress. And, if you\ntry to access the value of a rule that hasn't been updated yet, it's\nautomatically updated on-the-fly so that it reflects the current event in\nprogress.\n\nNo stale data. No race conditions. No callback management. That's what the\nTrellis gives you.\n\nHere's a super-trivial example::\n\n >>> from peak.events import trellis\n\n >>> class TempConverter(trellis.Component):\n ... F = trellis.maintain(\n ... lambda self: self.C * 1.8 + 32,\n ... initially = 32\n ... )\n ... C = trellis.maintain(\n ... lambda self: (self.F - 32)/1.8,\n ... initially = 0\n ... )\n ... @trellis.perform\n ... def show_values(self):\n ... print \"Celsius......\", self.C\n ... print \"Fahrenheit...\", self.F\n\n >>> tc = TempConverter(C=100)\n Celsius...... 100\n Fahrenheit... 212.0\n\n >>> tc.F = 32\n Celsius...... 0.0\n Fahrenheit... 32\n\n >>> tc.C = -40\n Celsius...... -40\n Fahrenheit... -40.0\n\nAs you can see, each attribute is updated if the other one changes, and the\n``show_values`` action is invoked any time the dependent values change... but\nnot if they don't::\n\n >>> tc.C = -40\n\nSince the value didn't change, none of the rules based on it were recalculated.\n\nNow, imagine all this, but scaled up to include rules that can depend on things\nlike how long it's been since something happened... whether a mouse button was\nclicked... whether a socket is readable... or whether a Twisted \"deferred\"\nobject has fired. With automatic dependency tracking that spans function\ncalls, so you don't even need to *know* what values your rule depends on, let\nalone having to explicitly code any dependencies in!\n\nImagine painless MVC, where you simply write rules like the above to update\nGUI widgets with application values... and vice versa.\n\nAnd then, you'll have the tiny beginning of a mere glimpse... of what the\nTrellis can do for you.\n\nOther Python libraries exist which attempt to do similar things, of course;\nPyCells and Cellulose are two. However, only the Trellis supports fully\ncircular rules (like the temperature conversion example above), and intra-pulse\nwrite conflict detection. The Trellis also uses less memory for each cell\n(rule/value object), and offers many other features that either PyCells or\nCellulose lack.\n\nThe Trellis package can can be `downloaded from the Python Package Index`_ or\ninstalled using `Easy Install`_, and it has a fair amount of documentation,\nincluding the following manuals:\n\n* `Developer's Guide and Tutorial`_\n\n* `Time, Event Loops, and Tasks`_\n\n* `Event-Driven Collections with the Trellis`_ (New features in 0.7a2)\n\n* `Software Transactional Memory (STM) And Observers`_\n\n* `Porting Code from Older Trellis Versions`_\n\n\nRelease highlights for 0.7a2:\n\n* Removed APIs that were deprecated in 0.7a1\n\n* Rollback now occurs over an entire atomic operation, even if more than one\n recalc pass occurs within that atomic operation.\n\n* Added ``collections.Hub`` type for publish/subscribe operations similar to\n PyDispatcher, but in a declarative, callback-free, and extensible manner.\n\n* Various bugfixes\n\n\nQuestions, discussion, and bug reports for the Trellis should be directed to\nthe `PEAK mailing list`_.\n\n.. _downloaded from the Python Package Index: http://pypi.python.org/pypi/Trellis#toc\n.. _Easy Install: http://peak.telecommunity.com/DevCenter/EasyInstall\n.. _PEAK mailing list: http://www.eby-sarna.com/mailman/listinfo/PEAK/\n.. _Developer's Guide and Tutorial: http://peak.telecommunity.com/DevCenter/Trellis#toc\n.. _Time, Event Loops, and Tasks: http://peak.telecommunity.com/DevCenter/TrellisActivity\n.. _Event-Driven Collections with the Trellis: http://peak.telecommunity.com/DevCenter/TrellisCollections\n.. _Software Transactional Memory (STM) And Observers: http://peak.telecommunity.com/DevCenter/TrellisSTM\n.. _Porting Code from Older Trellis Versions: http://peak.telecommunity.com/DevCenter/TrellisPorting\n.. _porting guide: http://peak.telecommunity.com/DevCenter/TrellisPorting\n\n.. _toc:", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://peak.telecommunity.com/DevCenter/Trellis", "keywords": null, "license": "PSF or ZPL", "maintainer": null, "maintainer_email": null, "name": "Trellis", "package_url": "https://pypi.org/project/Trellis/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/Trellis/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://peak.telecommunity.com/DevCenter/Trellis" }, "release_url": "https://pypi.org/project/Trellis/0.7a2/", "requires_dist": null, "requires_python": null, "summary": "A simple \"untwisted\" approach to event-driven programming", "version": "0.7a2" }, "last_serial": 785900, "releases": { "0.5b1": [ { "comment_text": "", "digests": { "md5": "9e5248acf3bad385df52743b09f77406", "sha256": "051a73abe14d7fb674da39ba47bb4d56409305a645bce6822b268e862420711d" }, "downloads": -1, "filename": "Trellis-0.5b1-py2.3.egg", "has_sig": false, "md5_digest": "9e5248acf3bad385df52743b09f77406", "packagetype": "bdist_egg", "python_version": "2.3", "requires_python": null, "size": 157325, "upload_time": "2007-08-10T19:14:00", "url": "https://files.pythonhosted.org/packages/99/60/1274c1f624dc449a6d609e75c1135be0610d075ad0fea5931ebaad9ee941/Trellis-0.5b1-py2.3.egg" }, { "comment_text": "", "digests": { "md5": "cb8d395001fcd4fa8084ec7817835b1f", "sha256": "9e41d3ada5092e3dfb8bec11df527e0965cf6c0f94e0765ee096ae6f54f9a36d" }, "downloads": -1, "filename": "Trellis-0.5b1-py2.4.egg", "has_sig": false, "md5_digest": "cb8d395001fcd4fa8084ec7817835b1f", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 42624, "upload_time": "2007-08-10T19:13:49", "url": "https://files.pythonhosted.org/packages/9a/ae/3cf2019f91368d824e9e8d1bcf681263877f3b68d1a2bfe7aad5e58873de/Trellis-0.5b1-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "814f3a8509916c6ca0b2e5ef7ea3f4f3", "sha256": "0f4b815494d88bc6f3aa3a185060c2e68c5ecfa41c8e6300176d0a6c3f3da474" }, "downloads": -1, "filename": "Trellis-0.5b1-py2.5.egg", "has_sig": false, "md5_digest": "814f3a8509916c6ca0b2e5ef7ea3f4f3", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 41650, "upload_time": "2007-08-10T19:13:36", "url": "https://files.pythonhosted.org/packages/97/ab/eb419434319bcd8b7f3536706d36d4265b699ac4c425752a123bc7a2ad99/Trellis-0.5b1-py2.5.egg" }, { "comment_text": "", "digests": { "md5": "83ab98091064386d70dc23713d1ff3e1", "sha256": "f28e629edcfe22c5462a95faa158f120da33559c70d1beafdf1ef711d0a04905" }, "downloads": -1, "filename": "Trellis-0.5b1.zip", "has_sig": false, "md5_digest": "83ab98091064386d70dc23713d1ff3e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 65701, "upload_time": "2007-08-10T19:13:35", "url": "https://files.pythonhosted.org/packages/40/55/d35176a049df0f3d15c81455a403d31cff0458586dffcad022a858dc4c5e/Trellis-0.5b1.zip" } ], "0.6a1": [ { "comment_text": "", "digests": { "md5": "34a0e4af7e9dc882406db91b6c1551ad", "sha256": "6f8eef2e536ff1eff59f812885150135a1b26facf6759b8b1522ceb4f3deb776" }, "downloads": -1, "filename": "Trellis-0.6a1-py2.3.egg", "has_sig": false, "md5_digest": "34a0e4af7e9dc882406db91b6c1551ad", "packagetype": "bdist_egg", "python_version": "2.3", "requires_python": null, "size": 309951, "upload_time": "2008-01-07T22:42:24", "url": "https://files.pythonhosted.org/packages/f8/48/a57b2a4ef046757e77ab4798578f8f187fcfc53bdc962d5fb5dbf473b005/Trellis-0.6a1-py2.3.egg" }, { "comment_text": "", "digests": { "md5": "3796c8756f7a621ecb8cbb8d9e3854dc", "sha256": "2d8e2fff8f33c9c7317c8433c7236f3ffc04740d7185aea9aa1511b30ced0b43" }, "downloads": -1, "filename": "Trellis-0.6a1-py2.4.egg", "has_sig": false, "md5_digest": "3796c8756f7a621ecb8cbb8d9e3854dc", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 82599, "upload_time": "2008-01-07T22:42:14", "url": "https://files.pythonhosted.org/packages/3c/64/23a0fadbc3afde2a21b62e11c096294e653a4f8b729c5e2a0f7365810581/Trellis-0.6a1-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "abd4d9aaf313e75c49252d0c9d5e820d", "sha256": "87b2060279dc143fdb1050aac19591511a2a3a4c3e9003a50ae40d75df7f5a85" }, "downloads": -1, "filename": "Trellis-0.6a1-py2.5.egg", "has_sig": false, "md5_digest": "abd4d9aaf313e75c49252d0c9d5e820d", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 81370, "upload_time": "2008-01-07T22:41:50", "url": "https://files.pythonhosted.org/packages/19/c9/a3f76e6d25f2e8c28ae6b8b8f077470424631ff6812ebfa82b6746e96c6e/Trellis-0.6a1-py2.5.egg" }, { "comment_text": "", "digests": { "md5": "673f1db10125fb3175979df9e4c682e2", "sha256": "88a40931661284553106d09279ca11dc07d03c98642342dbfe2adc42d833fbfa" }, "downloads": -1, "filename": "Trellis-0.6a1.zip", "has_sig": false, "md5_digest": "673f1db10125fb3175979df9e4c682e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 102419, "upload_time": "2008-01-07T22:41:47", "url": "https://files.pythonhosted.org/packages/5b/f5/0050905338cce495cb026138e76fb4ffe7dcb5e2307877b9bc0364ff2379/Trellis-0.6a1.zip" } ], "0.7a1": [ { "comment_text": "", "digests": { "md5": "cffa82712b168d9ca949467a4953ad35", "sha256": "0b171d37a4763ed36256b20d7ae811aff6016cd8fca0913c33846458a36352b2" }, "downloads": -1, "filename": "Trellis-0.7a1-py2.3.egg", "has_sig": false, "md5_digest": "cffa82712b168d9ca949467a4953ad35", "packagetype": "bdist_egg", "python_version": "2.3", "requires_python": null, "size": 377303, "upload_time": "2008-04-29T00:22:11", "url": "https://files.pythonhosted.org/packages/9a/ed/b01b888fda4937d29987015f2ff1c0ace22c02d11cc16c9cab095e0c6eb2/Trellis-0.7a1-py2.3.egg" }, { "comment_text": "", "digests": { "md5": "ccb60c612b9938f714ba8d081ba14036", "sha256": "d82624730c80126339e08dae737c7129a7d3dec2442844688b009fc70b157378" }, "downloads": -1, "filename": "Trellis-0.7a1-py2.4.egg", "has_sig": false, "md5_digest": "ccb60c612b9938f714ba8d081ba14036", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 106529, "upload_time": "2008-04-29T00:22:55", "url": "https://files.pythonhosted.org/packages/7c/48/59f2b543386a37e7dc16b34355541cf61b69074d9c5952b72220578939ca/Trellis-0.7a1-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "1c8148eb2ccd374e6840a5a9f1ee764e", "sha256": "c5d50f397a85fedc0a25ed89934878783a6d2b022a1d752f38e65ebb45628bfd" }, "downloads": -1, "filename": "Trellis-0.7a1-py2.5.egg", "has_sig": false, "md5_digest": "1c8148eb2ccd374e6840a5a9f1ee764e", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 104753, "upload_time": "2008-04-29T00:15:48", "url": "https://files.pythonhosted.org/packages/8d/28/b3fda0bd7f196348b61c822253182fd9fa0045e5f1f18560640e1cd8f582/Trellis-0.7a1-py2.5.egg" }, { "comment_text": "", "digests": { "md5": "2a6a65197f10a10d0420a2bc5fa88d66", "sha256": "83bc4b89b9c70cfc6eeffee5d8d33e79284047cb3f1beaf00ddb33c496479a9a" }, "downloads": -1, "filename": "Trellis-0.7a1.zip", "has_sig": false, "md5_digest": "2a6a65197f10a10d0420a2bc5fa88d66", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 112291, "upload_time": "2008-04-29T00:15:41", "url": "https://files.pythonhosted.org/packages/a5/ee/c36dab2e1db97f6b01670896c15890a1ae714f532a2d19fec43a6cdc5c2b/Trellis-0.7a1.zip" } ], "0.7a2": [ { "comment_text": "", "digests": { "md5": "4145f55498e3889e586a32804bc98870", "sha256": "6a3cfdc42e09a96cb121f2aab6bdc9cbef33573b3cfc0089e213f4af60107ba2" }, "downloads": -1, "filename": "Trellis-0.7a2.zip", "has_sig": false, "md5_digest": "4145f55498e3889e586a32804bc98870", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 115424, "upload_time": "2008-05-23T16:50:29", "url": "https://files.pythonhosted.org/packages/7d/e4/8a1da0503ccc6d76bcf4f83312e8d74e87d8097fbd4f7f85f3e2719ef0a4/Trellis-0.7a2.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4145f55498e3889e586a32804bc98870", "sha256": "6a3cfdc42e09a96cb121f2aab6bdc9cbef33573b3cfc0089e213f4af60107ba2" }, "downloads": -1, "filename": "Trellis-0.7a2.zip", "has_sig": false, "md5_digest": "4145f55498e3889e586a32804bc98870", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 115424, "upload_time": "2008-05-23T16:50:29", "url": "https://files.pythonhosted.org/packages/7d/e4/8a1da0503ccc6d76bcf4f83312e8d74e87d8097fbd4f7f85f3e2719ef0a4/Trellis-0.7a2.zip" } ] }