Repository navigation
Abort Ongoing Tile Requests When New Tileset is Created - #5342
Conversation
|
Hey! This looks good. I pulled it down yesterday and started to think about how we might add a test to cover it. I was thinking we could load a couple tiles, some loaded, some pending, then finalize and check the cache to look as expected. Do you have an ideas for how you'd test it? |
|
I tried adding a test using |
|
@chrisgervang I just realized we probably want to test the layer as well. I will add that as well. |
|
Sounds good. I've written a second test for tileset-2d to cover a partial load, and a reload. Check it out here ilan-gold/deck.gl@abort_tile_requests_on_update...visgl:chr/abort_tile_requests_on_update |
|
@chrisgervang I'm realizing that because the old |
|
@ilan-gold You can query the tileset right after the initial update and hold on to the tile instances. |
|
@Pessimistress just saw this but had the same thought. Will do. |
For #5297. Adds a
finalizefunction to theTileset2Dto handle aborting the ongoing tile requests when a newTileset2Dis about to be made by the layer.I could add a test with
setTimeoutor something to guarantee tiles can actually be aborted but not sure that it's really a "unit test" at that point. Also, I don't think I need to do anything to the visibility of the tiles since the previous (i.e the one havingfinalizecalled)Tileset2D's tiles are all abandoned by the next render anyway (might have that wrong).Background
Rapid changes on
updateTriggersto theTileLayercan leave tile requests hanging, slowing down the application. This PR adds the ability to abort ongoing requests whenupdateTriggersare triggered.Change List
finalizefunction toTileset2Dfor aborting ongoing tile requests.tilestotilesetininitializeStatebecausetileswas removed some time ago. I can remove this though, just noticed it.