Great work! I have made most of my comments via the github comment
mechanism: http://github.com/pkieltyka/as3-amqp/comments
As I am using this for the first time, we will have to see whether it
is more useful that just free form emails.
On Tue, Aug 19, 2008 at 3:37 PM, Peter <peter.k...@gmail.com> wrote:
> Changes:
> 1. PublishClientImpl
> - Publishes messages to a topic based on the key provided. It queues
> messages prior to receiving a requestOk from the server.
Because realms have now been removed from the RabbitMQ default branch,
this can be removed (see inline comment for more detail).
> 2. SubscribeClientImpl
> - Subscribes to one or more topics and creates a listener for
> consuming messages to a callback function. It queues subscription
> requests until a requestOk is received from the server.
See above for comment about realms.
>
> 3. PublishSubscribeClientImpl
> - This is a combined version of 1&2 above, for two reasons. One, the
> clients extend the AbstractDelegate class which opens a new connection
> each time, this will require an intermediary state for the connection
> like CONNECTING so other clients do not attempt to start a connection
> while one is connecting. Two, if the client subscribes to a topic, and
> immediately following a call is made to publish to that topic on some
> consumption function, the message will be sent out before the
> subscription is made in most cases, and the message will not be
> consumed. The solution is to buffer the messages specific to a topic.
Hmmm, I can see where you are coming from, but I wonder if there is a
cleaner way to do this. I will have to look into it.
> - Also note that you can use this client without subscribing to any
> topic
> - An unsubscribe method is available to purge the bound replyQueue for
> the topic
This can be achieved by autodelete, IMHO, see inline comment.
> 4. PublishSubscribeClientTest
> - Test suite that demonstrates the functionality of
> PublishSubscribeClientImpl
>
>
> TODO / Further exploration:
> - Ben Hood (creator of this library) mentioned that request/requestOk
> is being phased out of rabbit, all of the clients wait for a requestOk
> before making requests to the server. This is how I've left it for the
> time being until AbstractDelegate is updated by Ben.
This can now be deleted :-)
Whether you do it and I merge, or I do it and you resync is your choice.
> - Multiple invocations to client constructors (via an intermediary
> CONNECTING state)
Not sure, see comment above.
> - Optimize the file size of overall library to decrease its 304kb
> weight down to something reasonable. For one, I noticed the core
> library depends on flexunit.swc, which weighs in at 400kb itself.
> Perhaps looking at removing that dependency will cut some fat, in
> particular the ArrayList class is used and should be substituted with
> something already available.
This is an excellent idea.
Ben
On Thu, Aug 7, 2008 at 3:07 PM, Peter <peter.k...@gmail.com> wrote:
> From my testing, there currently is an issue where the two clients
> make two connections when calling super(c) (the AbstractDelegate
> constructor). We could modify the constructor in AbstractDelegate to
> check if a connection exists and then to simply return, but this is
> Ben's decision of how he intends the library to work.
Yes, this is good point, which I'll have to think about what is the
most elegant solution.
Stupidly, I've only got my AS3 environment set up on my laptop which
is currently sitting at Apple in the repair section :-(
So I'll get FB going on my desktop :-)
Ben