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

Backtrack should be a GET param #36

Open
omares opened this issue Jun 24, 2012 · 4 comments
Open

Backtrack should be a GET param #36

omares opened this issue Jun 24, 2012 · 4 comments

Comments

@omares
Copy link

omares commented Jun 24, 2012

To be more REST compatible the backtrack option should be a GET parameter instead of munching it together with the resource aka channel_id.

The resource you work on is the channel_id. When mixing in the backtrack param you are accessing another resource which by definition should have nothing in common with the channel you want information on. In other words $channel_id.b5 is another resource (simply with another name like 6.b5) and thus should not return the stored message of the channel you actually want to access.

A desired and valid call to get the last 5 message of the resource/channel 6 would be:

/sub/6?backtrack=5
@wandenberg
Copy link
Owner

Hi this is not a REST service.
Actually we support subscribe to more than one channel using the same connection, this is done using channels ids on url, like /sub/ch1/ch2.
To get old messages on this channels you may do /sub/ch1.b3/ch2.b6.
If we change to be like a REST service this will not be possible to be done.

@omares
Copy link
Author

omares commented Jun 24, 2012

I know this is not a rest service but it would be easy to comply to rest standards, so you could use it as a rest service.

To connect to more than one channel a GET on the resource /sub with query params could be used:

GET /sub?channel=1&channel=2&backtrack=1.6&backtrack=2.3

@tomtaylor
Copy link

+1 on this - it'd be great to customise where the backtrack parameter can be passed in from, perhaps using a push_stream_backtrack_tag option.

@wandenberg
Copy link
Owner

Hi,

I'm checking what we can do about that, but I had some doubts.
If we follow your suggestion, and the user has many channels on the same connection or some channels with big names, the query string will be huge.

GET /sub?channel=A&channel=B& ... channel=X&channel=Z&backtrack.A=6&backtrack.B=3& ... backtrack.X=6&backtrack.Z=3

GET /sub?channel=a_very_bid_channel_name_like_a_session_id&backtrack.a_very_bid_channel_name_like_a_session_id=6

You really think this is the best approach?

I thought in some other options

#using a dot notation
GET /sub?channel=A.6&channel=B.3
#using brackets notation
GET /sub?channel=a_very_bid_channel_name_like_a_session_id[6]

In any case the "channel" and "backtrack" parameters names will be configurable.

What do you think?

@wandenberg wandenberg removed this from the 0.4.x milestone Jan 2, 2015
@omares omares removed this from the 0.4.x milestone Jan 2, 2015
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

No branches or pull requests

3 participants