Hi,

A hint: Wicket won't flush the response if the request is in async mode:
https://github.com/apache/wicket/blob/286240202cc3cc673cc2f973b6e46da66e7097fc/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/ServletWebResponse.java#L313
https://github.com/apache/wicket/blob/286240202cc3cc673cc2f973b6e46da66e7097fc/wicket-core/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java#L242

I've used Servlet 3.1 async functionality in Wicket IResource in the past.

For Rx this won't help you much though.
At the moment at render time Wicket traverses the component tree and calls
#render() for each Component and its behaviors. They all append text to the
WebResponse. At the end of the request cycle the accumulated content is
being written to
the HttpServletResponse.
If a Component uses an Rx model then you will need to postpone somehow its
contribution to the content. Finally when all Rx data is available you will
need to lazily evaluate the postponed contributions.
Components implementing IFeedback interface are treated specially, so
FeedbackPanels can collect the feedback from Components which are later in
the Page.
I hope this information is useful for you to implement this!

Martin

On Fri, Sep 18, 2020 at 12:13 PM Emmanuel Sowah <eso...@gmail.com> wrote:

> Sure, Sven!
>
> On Fri, Sep 18, 2020 at 11:07 AM Sven Meier <s...@meiers.net> wrote:
>
> > That would be a nice addition to wicketstuff.
> >
> > Please keep us updated on how you solved it.
> >
> > Have fun
> > Sven
> >
> >
> > On 18.09.20 11:02, Emmanuel Sowah wrote:
> > > Hi Korbinian,
> > >
> > > Thanks for the quick response.
> > > I will look into the native websockets option and see if I can work
> > > something out.
> > > It would be nicer though if wicket could support reactive programming
> > > natively, and for example simply pass Flux<T> data to a repeater like
> > > ListView<Flux<Person>> or a Mono<T> as a model to a wicket Label.
> > >
> > > Cheers
> > >
> > > On Fri, Sep 18, 2020 at 10:45 AM Korbinian Bachl <
> > > korbinian.ba...@whiskyworld.de> wrote:
> > >
> > >> Maybe Ajax
> > >>
> > >>
> >
> https://ci.apache.org/projects/wicket/guide/9.x/single.html#_creating_custom_ajax_call_listener
> > >> or Websockets ....
> > >>
> > >>
> >
> https://ci.apache.org/projects/wicket/guide/9.x/single.html#_native_websockets
> > >>
> > >> ----- Ursprüngliche Mail -----
> > >>> Von: "Emmanuel Sowah"
> > >>> An: "users" <users@wicket.apache.org>
> > >>> Gesendet: Freitag, 18. September 2020 10:35:24
> > >>> Betreff: Does wicket 9 support reactive programming?
> > >>> Hi,
> > >>>
> > >>> I am using spring 5 and via reactive programming, I am receiving a
> Flux
> > >>> data which I am trying to display in a table on a Wicket page.
> However
> > I
> > >>> get an exception during rendering of the table. The exception
> basically
> > >>> says the RequestCycle is closed, which sounds logical to me if wicket
> > is
> > >>> not supporting reactive programming due to the non-blocking nature of
> > >>> reactive programming.
> > >>>
> > >>> Does someone have a work-around for this problem? I was thinking
> along
> > >> the
> > >>> lines of saving the RequestCycle and reusing it when data arrives
> later
> > >> but
> > >>> I am not sure if that is the right way to go.
> > >>>
> > >>> Currently I am using blocking on the reactive stream as a work-around
> > but
> > >>> that leads to a sequential behaviour, which of course defeats the
> basic
> > >>> idea of reactive programming.
> > >>>
> > >>> Any tips or ideas?
> > >>>
> > >>> Cheers,
> > >>> Emmanuel
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > >> For additional commands, e-mail: users-h...@wicket.apache.org
> > >>
> > >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>

Reply via email to