themeparks icon indicating copy to clipboard operation
themeparks copied to clipboard

5.0 Allow appropriate Disney parks object to push status changes

Open mledford opened this issue 7 years ago • 4 comments

Is your feature request related to a problem? Please describe. It would be great to get wait times pushed to you instead of having to poll every X time interval for changes.

Describe the solution you'd like I would like to be able to provide a closure or promise to run some code when a wait time status changes for appropriate Disney parks. This would be an optional feature.

Additional context I raised issue #128 when looking at the possibility of adding this functionality. It would seem that slight modifications to the cache structure might make this easier or more clean. Though I realize that you still have some Disney parks which do not yet support the live updates so backwards compatibility is important and could make this slightly more complex.

mledford avatar Aug 18 '18 18:08 mledford

I like this a lot, I have had a plan in the back of my head to add this later, but also to roll similar functionality out to all the "non-live" parks where the library will automatically do polling every 5 minutes or so and call the same event broadcasts as if it had just happened live.

The couchbase fetching classes are already setup as event emitters with this roughly in mind, if you've had a poke at the bus example, you can see this is setup with event emitters and is quite satisfying seeing all the buses roaming around :)

I need to experiment a little with seeing if making parks eventemitters causes all sorts of hell or not, or it isn't too hard to setup our own "OnRideUpdate( callbackFunc )" sort of system.

cubehouse avatar Aug 18 '18 19:08 cubehouse

I did notice the emitter code! This is where I wondered if restructuring the sync data would make more sense. Where the sync data keeps track of stuff and then the emitter would push the data to the parks and then that is how data is actually cached and then callback/promise called. Again, looking for what you are wanting to happen and get feedback. I'm happy to lend a hand on some of this as it is something that I would very much want myself. Just let me know if there is something I can do.

mledford avatar Aug 18 '18 19:08 mledford

Just wanted to chime in that it's definitely possible for Disney parks to watch for wait time changes. I'm testing with WDW and a single channel spits back live updates for all attractions at the resort. The biggest issue is that the facility status channel lacks names. I copied the logic from the fetch wait times code to get all the status channel documents, then fetched the facility names. Here's the test script.

DougSisk avatar May 14 '19 00:05 DougSisk

Start of implementation for this is in #193

cubehouse avatar Jun 23 '19 22:06 cubehouse