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

Re-arrange RPC arguments to allow route agnosticism #5

Closed
faultyserver opened this issue Mar 16, 2017 · 2 comments
Closed

Re-arrange RPC arguments to allow route agnosticism #5

faultyserver opened this issue Mar 16, 2017 · 2 comments

Comments

@faultyserver
Copy link
Member

faultyserver commented Mar 16, 2017

In many cases, queries for the next arrivals at a station are interested in all arrivals, not just those from a particular route. However, the current RPC argument structure for the visits_* family is (station, route, timestamp, count), meaning route is not a parameter that can be omitted.

To allow for both calls that request arrivals from a particular route and that don't, a better RPC definition is:

visits_after(station, timestamp, route="", count);

Note that the route parameter is optional, but is not the last parameter. The current WAMP library that timetable uses does not allow for optional parameters, nor does it allow registering multiple procedures under the same name. In other words, this structure is not possible with the current WAMP library, but is the ideal case and should be considered if the underlying WAMP library changes.

For now, however, a simple fix is to create two distinct procedures that take these different argument sets. They could be:

visits_after(station, timestamp, count);
visits_after_from_route(station, timestamp, route, count);

This should handle the structure for now, but should not be considered a final solution.

faultyserver added a commit that referenced this issue Mar 16, 2017
…rder.

`visits_between` seems to be the call that will be made most commonly, so testing with it is more accurate to real-world use.

Per #5, the argument order of the RPCs has been adjusted to have `route` as the next-to-last parameter. At the moment, only the route-agnostic RPC is implemented.

Per #6, `route` and a temporary `headsign` placeholder have been added to each visit in an RPC response. I'm not entirely sure that `headsign` is a rational field to include, as it is an optional GTFS field, and doesn't really provide any information that can't be gleaned from the route itself.
@faultyserver
Copy link
Member Author

This is directly related to #3 as the gateway to implementing RPCS with optional route parameters.

@faultyserver
Copy link
Member Author

Closed by #7.

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

No branches or pull requests

1 participant