GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - python-effect/txeffect: Twisted/Effect integration

BranchesTags
Open more actions menu

Latest commit

 

History

22 Commits
22 Commits

Folders and files

NameName
Last commit message
Last commit date
docs/source
docs/source
 
 
txeffect
txeffect
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
Makefile
Makefile
 
 
README.rst
README.rst
 
 
dev-requirements.txt
dev-requirements.txt
 
 
setup.cfg
setup.cfg
 
 
setup.py
setup.py
 
 

Repository files navigation

txEffect

https://travis-ci.org/python-effect/txeffect.svg?branch=master

txEffect is a small library for integrating Twisted and Effect, mostly around Deferred<->Effect interoperation. Documentation is available at https://txeffect.readthedocs.org/

Effect is a library for helping you write purely functional code by isolating the effects (that is, IO or state manipulation) in your code. Documentation is available at https://effect.readthedocs.org/.

Examples

Perform an Effect to get a Deferred with txeffect.perform.

from txeffect import perform
d = perform(my_dispatcher, some_effect)
d.addCallback(log.msg)

Implement a performer for an intent that returns a Deferred with txeffect.deferred_performer.

from twisted.internet.defer import succeed
from txeffect import deferred_performer

@deferred_performer
def perform_foo(dispatcher, intent):
    return succeed('hello, world')

Perform standard Delay and parallel effects using asynchronous implementations with txeffect.make_twisted_dispatcher.

from twisted.internet import reactor
from txeffect import make_twisted_dispatcher

dispatcher = make_twisted_dispatcher(reactor)
p_effs = parallel([Effect(Delay(5), Effect(Delay(3), Effect(Delay(1))))])
perform(dispatcher, p_effs).addCallback(
    lambda: print("5 seconds have passed!"))

Working examples can be found at the effect-examples GitHub repo.

Thanks

Thanks to Rackspace for allowing me to work on this project, and having an excellent open source employee contribution policy

IRC

There is a #python-effect IRC channel on irc.freenode.net.

License

txEffect is licensed under the MIT license:

Copyright (C) 2014 Christopher Armstrong

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Twisted/Effect integration

Resources

Readme
Activity
Custom properties

Stars

3 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.