Search
Code Directory
 ASP
 ASP.NET
 C/C++
 CFML
 CGI/PERL
 Delphi
 Development
 Flash
 HTML
 Java
 JavaScript
 Pascal
 PHP
 Python
 SQL
 Tools
 Visual Basic & VB.NET
 XML
New Code
Excel Add-in for DB2 1.7
wolfSSL 4.0.0
EntityDAC Express 2.2
SecureBridge 9.1
C# HTML to PDF 2019.6.5
PHP Ecommerce Script 3.6
Devart SSIS Data Flow Components 1.11
dbForge Data Compare for PostgreSQL 3.2.15
OrgChart JS 4.9.7
iScripts CyberMatch 1.3.3
AnyGantt JS Gantt Charts 8.7.0
Database Workbench Pro 5.6.8
SentiMask SDK Trial 2.0.193121
dbForge Studio for SQL Server 5.8
ODBC Driver for ASE 2.1.2
Top Code
iScripts CyberMatch 1.3
SecureBridge 8.0
dbForge Data Compare for PostgreSQL 2.0
dbForge Studio for SQL Server 5.5
Database Workbench Pro 5.6.8
PHP Ecommerce Script 1.0.4
ATN Site Builder 3.0
Availability Booking Calendar PHP 1.0
ATN Resume Finder 2.0
Excel Add-in for DB2 1.1
PHP Review Script 1.0
EntityDAC Express 2.2
ICPennyBid Penny Auction Script 4.0
Azizi search engine script PHP 4.1.10
GnuWin64 64
Top Rated
VisualNEO Web 2018.12.15
Azizi search engine script PHP 4.1.10
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Deals and Discounts Website Script 1.0.2
ADO.NET Provider for ExactTarget 1.0
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
Invoice Manager by PHPJabbers 3.0
ICPennyBid Penny Auction Script 4.0
PHP Review Script 1.0
ATN Resume Finder 2.0
ATN Site Builder 3.0
Availability Booking Calendar PHP 1.0
actorish decorator for making async code look more like sync one and a less blocking 
File ID: 64228






actorish decorator for making async code look more like sync one and a less blocking 
Download actorish decorator for making async code look more like sync one and a less blocking http://code.activestate.com/recipes/577922-partial-with-out-of-order-arguments/?in=lang-pythonReport Error Link
License: Freeware
Downloads: 6
Submit Rating:
actorish decorator for making async code look more like sync one and a less blocking  Description
Description: I like how gevent is making async code to look like sync but non blocking without all the ugly callbacks.
I tried doing that with threads and object proxy (I found great one at: http://pypi.python.org/pypi/ProxyTypes written by Phillip J. Eby, and this is where the actual magic happens).

For every function that is decorated it returns a proxy and the io call (or anything else) won't block until the value is actually needed.
(should be some pools and args pickling there, to make it more like message passing but I didn't want to fuzzy the example)
To use it as actor model, I guess it would require to queue requests to decorated object's methods and create a single thread to process them an in LazyProxy callback set q.get() instead of t.join()

License: Freeware

Related: actor, threading

O/S:Windows

Downloads: 6



More Similar Code

code2web is a toolkit for converting source code (Java,JavaScript,XML,JSP,SQL and more) to HTML with a wide array of features, including CSS customization, outline generation, automatic documentation liking, selective highlighting and more.



RAD Studio Code Generator represents a set of code generating tools for development IDEs that lack basic code completion features (like generating getters and setters for class members).



A decorator for generators that makes them indexable like a
sequence.



I wanted to make my tag cloud (new with WP 2.3) look more like the one generated by del.icio.us, with a flush margin on both the left and the right. But when I tried to do it, it sucked because the internal spaces in the tags had been replaced by...



A simple .NET signature box for handheld application. Usage of bezier curves makes the resulting signature look more like the pen and paper version.



Do you ever curse Java for making it so ridiculously difficult just to save and load data?
Do you ever say something like the following:
"All I want to do is save the user's data! I don't want to deal with your...



Coati is an open source PHP/MySQL based Content Management System that strives for complete separation of code from content,
ease of use, and a feature rich management system.



JavaGuard is a general purpose bytecode obfuscator, designed to fit effortlessly into your regular build and testing process, providing peace of mind that your valuable Java code is more secure against decompilation and other forms of reverse...



OpenStage is a cross-platform staging process intended to provide a universal staging mechanism for multiple source-code repositories such as CVS, Subversion, and Mercurial.



KeyValue is a cross-platform library for making C++ objects accessible through LibreOffice Calc, Excel and other front-ends. Experience of spreadsheet users is enhanced by an object model and a handy key-value based interface.

User Review for actorish decorator for making async code look more like sync one and a less blocking
- required fields
     

Please enter text on the image