Skip to content

Conversation

@jakubkulhan
Copy link
Owner

@jakubkulhan jakubkulhan commented Jan 6, 2019

This pull request introduces backwards-incompatible changes that should become the next generation of this library, version 1.0.

It should solve some (long-standing) issues:

  • Automatic reconnect in case of connection failures. => Client instance won't be tied to a single connection. Instead it will present a simpler interface that can tolerate reconnections.
  • Problems with heartbeats. => Most of the problems reported by users of the library were due to heartbeat timeouts. The library should provide in such cases helpful exception messages.

As well as some design issues:

  • Mocking - So far, the library tied everything to concrete classes that couldn't be mocked easily. Now, client/connection/channel will extend interfaces that can be easily mocked.
  • Channels - Most applications, I've worked on, that needed to publish a message, do not really care about AMQP's channel multiplexing. New client interface takes care of this use case.
  • Sync consumers - In the begging the library was created mostly because there was no AMQP lib for ReactPHP. Sync API was an afterthought. However, most consumers, I'd created, used sync client. New concept of a subscription - iterable instance that waits for messages consumed from multiple queues, - seems like a better fit.
  • Duplicated sync/async logic - New version will internally use coroutines for the protocol logic. Sync/async connections will be just executors for these coroutines. It should avoid duplication of the connection code and a lot of checks whether the returned value is a promise, or an actual value found now in the library code.

TODO:

@mmoreram
Copy link

@jakubkulhan hello!

Are you been thinking about the reconnection strategy?
How do you handle this in production environments?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants