-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow multiple channels to be created for a single connection #187
Allow multiple channels to be created for a single connection #187
Conversation
[#186] The aim here is to allow a client to create a connection out of a ConnectionStream and then use that to create multiple channels that different parts of the system can use. This supports the model recommended for rabbitmq where different threads operate on separate channels. * Added a `createConnection` method to the `Connection[F[_]]` trait alongside the existing `createConnectionChannel` * Created a `Channeller` trait (named to avoid clash with rabbit `Channel` class, up for a better name) with a `createChannel` method * Created a `ChannelStream` implementation that will create a stream of channels out of a provided connection * Created an `AMQPConnection` model to wrap a rabbit connection, in line with the `AMQPChannel` model * Bumped version to 1.2.1-SNAPSHOT for the moment
Codecov Report
@@ Coverage Diff @@
## master #187 +/- ##
=========================================
- Coverage 97.72% 94.5% -3.23%
=========================================
Files 15 16 +1
Lines 176 182 +6
Branches 2 3 +1
=========================================
Hits 172 172
- Misses 4 10 +6
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
|
||
import com.github.gvolpe.fs2rabbit.model.AMQPChannel | ||
|
||
// TODO: Find a better name - I've called it this to avoid clash with the rabbit class called Channel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming is hard 😄
It's fine and not so important in this case since it's just an internal algebra so we can leave it as is. Please remove the TODO comment :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I've removed the TODO. I haven't done any unit tests specifically for this. Is that okay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are always nice to have but it can be done in a different PR.
What I'm mostly concerned about is on whether we might run into thread-safety issues when creating multiple channels from the same connection. It would be great to add some tests for that (all tests run against a dockerized RabbitMQ).
[https://github.com//issues/186]
The aim here is to allow a client to create a connection out of a ConnectionStream and then use that to create multiple channels that different parts of the system can use. This supports the model recommended for rabbitmq where different threads operate on separate channels.
createConnection
method to theConnection[F[_]]
trait alongside the existingcreateConnectionChannel
Channeller
trait (named to avoid clash with rabbitChannel
class, up for a better name) with acreateChannel
methodChannelStream
implementation that will create a stream of channels out of a provided connectionAMQPConnection
model to wrap a rabbit connection, in line with theAMQPChannel
model