Commits

Show all
Author Commit Message Labels Comments Date
Nick Vatamaniuc
Simplify receive notify code, no need for extra flag. Remove log statements from actnet
Nick Vatamaniuc
Don't use syslog module
Nick Vatamaniuc
Implement active sockets like Erlang's gen_tcp and gen_udp Created a new module -- pyact.actnet that has 3 functions socket() : equivalent to socket.socket() connect() : equivalent to eventlet.connect() listen() : equivalent to eventlet.listen() These take all the original arguments plus an optional 'active' argument (see below for details) and return an active socket object. The active socket object is similar to eventlet's green socket object …
Nick Vatamaniuc
Use proper Event instead of calling hub.switch() Calling switch() directly messed up eventlet calls like select (and I suspect others too).
Nick Vatamaniuc
Prevent greenlet.switch() to be scheduled multiple times. A switch() to the actor is scheduled when a message send to that actor. If multiple messages are sent multiple switches would be scheduled. This could result in an extra switch, for example, when actor's greenlet is waiting for IO. It is necessary to only schedule a switch if the actor is waiting in the receive loop and a switch already hasn't been scheduled.
Nick Vatamaniuc
Don't mark actor as waiting if it is not currently waiting in receive()
Nick Vatamaniuc
Trying to implement a port mapper (like Erlang's EPMD). This is not used currently in the main code.
Nick Vatamaniuc
Added the ability to "cast" any Python objects, not just dict. Those objects just have to implement the _as_json_obj() method that should return a json object representation of the generic Python object. This lets users represent messages using classes, where they can access data using attribute syntax, for example.
Nick Vatamaniuc
Make wsgiapp handle Binary objects
nick.vatamaniuc
Added handling of binary blobs in actor messages. Binary values in python actors are wrapped in a Binary class, as in: binary = Binary(value). actor | binary To get the value of a binary use the .value property value = binary.value
Nick Vatamaniuc
Implemented remote wsgi actor calls
Nick Vatamaniuc
Make urlparser compatible with Python 2.4
Nick Vatamaniuc
remove debug print statement
Nick Vatamaniuc
Fixed bug in receive(...) edge case introduced in last commit. receive(timeout) # without any patterns was failing. Fixed, and added a unit test.
Nick Vatamanuc
Consolidate receive and receive_nowait by using a timeout. receive(...) acquired a timeout _keyword_ argument. If timeout is not specified, then the semantics of receive(...) has not changed. If timeout is 0, then the mailbox is checked only once and if nothing is matched then (None,None) is returned. This is equivalent to the old receive_nowait(...) call. If timeout > 0 the mailbox is checked for timeout seconds and if nothing matches (None,None) will…
Nick Vatamaniuc
Improved actors calling convention 1. Added Address.method(...) calling pattern to suppliment existing Address.call('method',...) pattern. 2. Added actor.build_call_pattern(method,message=object) function. This function can help the callee build its message pattern easier. Effectively it makes a copy of actor.CALL_PATTERN and replaces method and message keys with those provided by the user.
Nick.Vatamaniuc
Merge from fix from main actors repo
Nick.Vatamaniuc
Merged cast() fix from python-actors
Nick.Vatamaniuc
Merged avoiding creating GreenThread objects on cast from python-actors
Nick V.
Add Erlang-like .cast() syntax: address | message Override __or__ (|) operator for address such that address|message is syntax sugar for address.cast(message). Added corresponding unittest.
Comments 1
Nick V.
Implemented convenient Actor.response() method for call responses. Make it easier for a regular Actor (non-Server) to respond to calls without having to deconstruct the whole call message to extract messageid and address. Instead just call: self.receive(orig_message, response) This method does the extraction of the address and message_id behind the scenes and casts the response back. Example: def main(self): pat,msg = self.receive(CALL_PATTERN) …
Comments 1
Nick V.
Nick V.
Implemented receive_nowait() method. This method will check the mailbox but will not block waiting for message instead it will immediately return (None,None) for (pattern,match).
Nick.Vatamaniuc
Fix syntax error from previous commit
Nick.Vatamaniuc
Do not create extra greenlet during cast
Nick.Vatamaniuc
Avoid creating a new eventlet.GreenThread on each cast
Nick V.
Let wsgiapp use the same json module as pyact.actor. wsgiapp was specifically importing simplejson. Let it use the same json as main actor module.
Nick V.
Fix some edge cases in shape.py matching algorithms. See unittest diff for some of the previously failing cases. Here are some of them: 1. could not retrieve set's first shape with [0] use for e in eset: break idiom. 2. not container level type matching was performed for tuples, lists, sets & dicts. tried to always iterate over 'things' even thought things would have been non-iterable or tried use 'things' as dictionaries when th…
Nick V.
Add failing shape.py test: shape.is_shape_exc( {'hello':'world'}, 5 ) raises a TypeError instead of TypeMismatch. Basically is shape not a type then isinstance(thing,shape) doesn't make sense.
Nick V.
Make shape.py correctly match JSON string types in Python 2.x Python 2.x's 'json' module will decode a 'str' type as 'unicode'. This is according to the JSON spec, which states that strings are composed of 'any-Unicode-character...' (http://json.org). So when a user specifies 'str' as the type to match it works correctly in Python 3.x, where strings are unicode, but it doesn't work in Python 2.x, which has both 'str' and 'unicode' types. This commit adds sp…
  1. Prev
  2. Next