Allow a parent session to be explicitly passed to Base.show(...) #254
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm opening this PR mainly looking for a way forward with my attempts at allowing others to use the subsession mechanism to include multiple Bonito fragments sharing a single websocket. There is quite a bit of functionality in this package related to this, and its possible my understanding is lacking, so it could be there is a better one.
What I've added here is a
parent
keyword argument to Base.show(... text/html ...). This is a bit awkward since it will not be passed through the default dispatching so a string "text/html" won't get converted into ::MIME{:text/html}. This could possible to fix just for ::App which wouldn't get type piracy. Another -- perhaps nicer -- possibility would be to have an alternative function for writing apps to html which can have whatever arguments, and just have Base.show call that. What do you think?The example works, except when replacing the fragment there is an exception resulting from a date change targetting a now deleted element. This is essentially something stale being sent and it should get thrown away at some point rather than throwing an exception. I also haven't figured out how to tear down the task together when the session gets closed. Is it possible to receive an event for this? I think the task would still be stopped too late to solve all stale updates. Any guidance of whether there is existing stuff for this? If not, should I next add some events for session teardown?