Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Update ChannelManager #41

Merged

Conversation

snellingio
Copy link
Contributor

In reference to #6. The idea will eventually be to create additional channel managers. A good first start is allowing the user to swap the channel manager.

This commit:

  • Switches ChannelManager to an interface.
  • Moves old ChannelManager to a new ArrayChannelManager which implements the new ChannelManager interface.
  • Updates the config to allow for swapping.
  • Binds it to the ServiceProvider.

By turning ChannelManager into an interface, we keep compatibility with type hints everywhere else.

My only concern is adding something new the config, which people wouldn't have if they've already published it. Maybe I should fallback? Not sure what the best step forward is.

All the tests currently pass, but happy to add more tests if we'd like something specific tested. I'll be adding tests once I dig into implementing a new RedisChannelManager in a separate PR

Switch ChannelManager to an interface. Extend with an ArrayChannelManager (and copy the code). Update the config to allow for swapping. Bind it to the ServiceProvider
@snellingio
Copy link
Contributor Author

My only concern is adding something new the config, which people wouldn't have if they've already published it. Maybe I should fallback? Not sure what the best step forward is.

I have added a fallback to the ArrayChannelManager, so there should be no change required for anyone.

@@ -91,4 +91,9 @@
*/
'passphrase' => null,
],

/*
* Channel Manager
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some more info here on what this does and in which cases you would change this option

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

* This class handles how channel persistence is handled.
* By default, persistence is stored in an array by the running webserver.
* The only requirement is that the class should implement
* `ChannelManager` interface provided by this package.

@freekmurze freekmurze self-requested a review December 10, 2018 10:32
@mpociot mpociot merged commit ec96ca7 into beyondcode:master Dec 10, 2018
@mpociot
Copy link
Member

mpociot commented Dec 10, 2018

Looks good. Thank you for the PR!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants