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

removed screen for running version with JSServe #51

Closed
wants to merge 2 commits into from

Conversation

TabeaW
Copy link

@TabeaW TabeaW commented Jun 21, 2023

With this Tyler works smoothly with JSServe (#47). The only problem might be the for-loops which are now true permanently.

@lazarusA lazarusA requested a review from rafaqz June 21, 2023 11:46
@TabeaW
Copy link
Author

TabeaW commented Jun 21, 2023

using JSServe
using Tyler,Extents,WGLMakie
server=JSServe.Server("0.0.0.0", 8082)
extent=Extent(Y=(46.18,55.78),X=(3.088,17.112)) #Germany
tyler=Tyler.Map(extent)
route!(server, "/browser-display" => App(tyler.figure))

will show the tyler map in the JSServe App.

Copy link
Collaborator

@rafaqz rafaqz left a comment

Choose a reason for hiding this comment

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

Thanks. Im mostly concerned that this change means we are spawning tasks that never break out of their while loops.

src/Tyler.jl Outdated
depth, halo, scale
)
tyler.zoom[] = get_zoom(tyler, extent)
download_task[] = @async begin
while isopen(screen)
while true
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this mean the task runs forever now?

Copy link
Author

Choose a reason for hiding this comment

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

That's the big question, I am not quite sure about that, but had no real alternative without the screen in mind.

Copy link
Collaborator

Choose a reason for hiding this comment

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

My guess is this task will just keep running every 0.01 seconds until you kill the session, unless it hits another error from the Makie screen not being there anymore (but I think it wont?).

We can't really do that... we need to find another way of breaking the loop.

Copy link
Collaborator

@rafaqz rafaqz Jun 21, 2023

Choose a reason for hiding this comment

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

Maybe try printing to stdout in the task and see what happens

src/Tyler.jl Outdated
@@ -150,14 +147,10 @@ function Map(extent, extent_crs=wgs84;
empty!(tyler.displayed_tiles)
end
display_task[] = @async begin
while isopen(screen)
while true
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here

bug you need to first scroll in...
@SimonDanisch
Copy link
Member

I think I should add a function to makie a la waiting_isopen that waits until the scene/figure actually gets displayed and only then starts returning true/false! I think only with that we can have a clean condition for those loops

@SimonDanisch
Copy link
Member

Implemented in #69

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

Successfully merging this pull request may close these issues.

3 participants