A fast and minimal framework for building agent-integrated systems
Fixed a bug with broadcasting in an AMQPSpace - https://github.com/operand/agency/pull/79
Fixes an issue which would cause malformed messages to be repeatedly resent. https://github.com/operand/agency/pull/74. Thanks @wwj718!
pika AMQP library replaced with kombu. Kombu brings us a significant step closer to supporting multimedia and other great features such as compression or alternate messaging backends like Redis or Amazon SQS!
Fixed an issue preventing heartbeats from being sent causing connection drops.
Added generic AMQP connection options class AMQPOptions
.
Previously custom AMQP options were supplied as a pika.ConnectionParameters
object.
Moved AMQPSpace
and NativeSpace
classes into their own files.
Update your imports! For example:
from agency.space import AMQPSpace
should now be:
from agency.amqp_space import AMQPSpace
Space.add
and Space.remove
methods are now synchronous.
These methods will return only after the agent has been fully added/removed to the space or raises an exception.
The main feature of this release is the switch to the fantastic kombu messaging library. This introduced some breaking changes so the minor version was incremented. agency
is now at 1.2.0
I had already been eyeing kombu as a replacement for pika because of the many great features it supports. The heartbeat bug could've been fixed with the pika library, but I decided it would be better to make the switch now.
For one thing, integrating with kombu gets us a huge step closer to multimodal support! And it enables many more useful possibilities like compression etc.
Since the AMQP implementation has been completely rewritten, please report any issues you find.
Thanks so much!
Removed eventlet
library dependency from core library to prevent issues related to eventlet
Agent
class changes:
id
and will receive messages at
that id
and messages that are broadcast in their space."amq."
_after_add
and _before_remove
callbacks added for implementing
setup/teardown logic for agents._before_action
callback added (_after_action
already existed)Space
class changes:
Agent
class. If one wants to expose a space
instance as an agent as well, they can simply extend both the Space
and
Agent
classes to do so.Space
is now an abstract parent class and should not be instantiated
directly. There are now two Space
implementations to choose from:
NativeSpace
queue
classAMQPSpace
pika.ConnectionParameters
instance to configure connectivity
to your needs.Documentation updates
Demo changes
WebApp
class changes
Space
anymore and is no longer added to the demo space
as a distinct agent_after_add
to auto-discover available actions
upon being added to a spaceUpdated tests to include e2e tests of both native/amqp
I'm very excited for this release as I think it takes a solid step in the right direction, and improves on some earlier design decisions, leaving the project on better footing for the next series of improvements.
With the addition of AMQP support, the id
related changes, and others, I'm
hoping that Agency is less opinionated about the organization and naming of the
agents and systems in your application. No more forced hierarchy or "fully
qualified ids" etc. And AMQP opens the door for scalability and many more
interesting use cases.
Since the API changes are not backwards compatible, I bumped the minor version.
The latest agency
version is now 1.1.0.
Moving forward, expect more minor version increments when significant or non-backwards compatible features are added. Patch updates will maintain backwards compatibility with their minor versions. (This hasn't been true yet)
If you have issues or questions with any of these changes please let me know about it!
Thanks and happy coding!