Skip to content
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

Channels - RSN1 to RSN4a #18

Merged
merged 8 commits into from
Aug 5, 2015
Merged

Conversation

fjsj
Copy link
Contributor

@fjsj fjsj commented Aug 4, 2015

No description provided.

@mattheworiordan
Copy link
Member

Added a few comments, but overall this looks great.

(RSN1) Channels is a collection of Channel objects accessible through Rest#channels.
(RSN2) Methods should exist to check if a channel exists or iterate through the existing channels
Creates a new Channel object for the specified channel if none exists, or returns the existing channel. ChannelOptions can be specified when instancing a new Channel.
Releases the channel resource i.e. it’s deleted and can then be garbage collected
If options are provided, the options are set on the Channel. Accessing an existing Channel with options in the form Channels#get(channel, options) will therefore update the options on the channel and then return the existing Channel
@fjsj
Copy link
Contributor Author

fjsj commented Aug 4, 2015

Fixed the stuff you've mentioned. Sorry, your comments disappeared because I tried a wrong rebase.

EDIT: Your comments were:

  • As discussed, whilst we should support this, I would really prefer we add a release method as well please.
  • It would be nice to see a #get definition as follows instead of passing in None: channel_same = self.ably.channels.get('new_channel')
  • Seems crazy to have to catch the exception every time in Python 3, is there no better way to detect that it's Python 3 as opposed to catching an exception?


def get(self, name, options=None):
if isinstance(name, six.binary_type):
name = name.decode('ascii')

Copy link
Member

Choose a reason for hiding this comment

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

I will merge now, but where we write code to add 2/3 support, it may be nice to add a small comment with an explanation for future us.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. I'll add a comment in all lines I've changed for Python 3 support

mattheworiordan added a commit that referenced this pull request Aug 5, 2015
@mattheworiordan mattheworiordan merged commit b4c1094 into ably:master Aug 5, 2015
@mattheworiordan
Copy link
Member

Thanks

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

Successfully merging this pull request may close these issues.

None yet

2 participants