Re: async and thread constraint

2015-02-11 Thread Romain Manni-Bucau
all green with the trunk. That you very much. Romain Manni-Bucau @rmannibucau http://www.tomitribe.com http://rmannibucau.wordpress.com https://github.com/rmannibucau 2015-02-11 15:31 GMT+01:00 Mark Thomas : > On 11/02/2015 13:54, Romain Manni-Bucau wrote: >> that's it I think > > OK. Patch app

Re: async and thread constraint

2015-02-11 Thread Mark Thomas
On 11/02/2015 13:54, Romain Manni-Bucau wrote: > that's it I think OK. Patch applied to trunk and 8.0.x. Let us know how you get on. Mark > > If you want servlet code let's do it (wanted to avoid code in mail > since I never manage to format it well): > > 1) request 1 (start the async context

Re: async and thread constraint

2015-02-11 Thread Romain Manni-Bucau
that's it I think If you want servlet code let's do it (wanted to avoid code in mail since I never manage to format it well): 1) request 1 (start the async context) does: // field context has type AsyncContext context = req.startAsync(req, resp); context.addListener(this); // not important for u

Re: async and thread constraint

2015-02-11 Thread Mark Thomas
On 11/02/2015 09:35, Romain Manni-Bucau wrote: > Ok, let's look a jaxrs 2 sample and bind underlying implementation: > > @Path("touch") > @ApplicationScoped > public class Endpoint { > private volatile AsyncResponse current; > > @GET > public void async(@Suspen

Re: async and thread constraint

2015-02-11 Thread Romain Manni-Bucau
Ok, let's look a jaxrs 2 sample and bind underlying implementation: @Path("touch") @ApplicationScoped public class Endpoint { private volatile AsyncResponse current; @GET public void async(@Suspended final AsyncResponse response) { if (current == nu

Re: async and thread constraint

2015-02-11 Thread Rémy Maucherat
2015-02-11 10:15 GMT+01:00 Mark Thomas : > On 11/02/2015 07:58, Romain Manni-Bucau wrote: > > Well in two words if you take the most common example of JAXRS 2 > > continuation (@Suspended) it will do it (doing the link with > > servlets): > > > > -> request 1 -> suspend async context > > -> reques

Re: async and thread constraint

2015-02-11 Thread Mark Thomas
On 11/02/2015 09:21, Romain Manni-Bucau wrote: > Well it is not different and both should be allowed IMO, i just tried > to find a solution for the original bug without breaking common > usages. It should be easy to reproduce with a servlet: GET > /foo?start=true -> create an async context then GET

Re: async and thread constraint

2015-02-11 Thread Romain Manni-Bucau
Well it is not different and both should be allowed IMO, i just tried to find a solution for the original bug without breaking common usages. It should be easy to reproduce with a servlet: GET /foo?start=true -> create an async context then GET /foo?continuer=true -> resume without popping a new th

Re: async and thread constraint

2015-02-11 Thread Mark Thomas
On 11/02/2015 07:58, Romain Manni-Bucau wrote: > Well in two words if you take the most common example of JAXRS 2 > continuation (@Suspended) it will do it (doing the link with > servlets): > > -> request 1 -> suspend async context > -> request 2 -> async context dispatch (resume) > > issue is th

Re: async and thread constraint

2015-02-11 Thread Romain Manni-Bucau
Well in two words if you take the most common example of JAXRS 2 continuation (@Suspended) it will do it (doing the link with servlets): -> request 1 -> suspend async context -> request 2 -> async context dispatch (resume) issue is that resume is called from request 2. In other words ContainerThr

Re: async and thread constraint

2015-02-10 Thread Mark Thomas
On 10/02/2015 23:06, Konstantin Kolinko wrote: > 2015-02-10 14:16 GMT+03:00 Romain Manni-Bucau : >> Hi guys, >> >> in org.apache.coyote.AsyncStateMachine#asyncDispatch tomcat checks >> ContainerThreadMarker.isContainerThread() >> >> basically it prevents to use JAXRS 2 @Suspended without creating >

Re: async and thread constraint

2015-02-10 Thread Konstantin Kolinko
2015-02-10 14:16 GMT+03:00 Romain Manni-Bucau : > Hi guys, > > in org.apache.coyote.AsyncStateMachine#asyncDispatch tomcat checks > ContainerThreadMarker.isContainerThread() > > basically it prevents to use JAXRS 2 @Suspended without creating > custom threads - which is not intended. I do not know