Hi Jan,
On Thu, Jan 21, 2016 at 3:26 PM, Jan Algermissen <[email protected]> wrote: > Hi Endre, > > On Thursday, January 21, 2016 at 11:57:27 AM UTC+1, Akka Team wrote: >> >> Hi Jan, >> >> For these case I would use a simple >> java.util.concurrent.atomic.AtomicReference() and would set it from only >> one place (that can be an actor). Then you can read it safely from >> everywhere else. >> > > Actually, now that you wrote that I wonder whether a 'var' isn't just > enough since I will definitely only have one writer and a tolerance for the > var being not immediately updated on the other threads. > The issue can be that publishing won't be safe for non-primitive types since you would be able to see them (at least theoretically) in half-initialized state and all kind of weirdness. It probably does not matter in your case but why take changes. > > IOW, I actually do not need the guarantees of atomic reference, either. > On the other hand it is good practice, and the cost of it is minimal. I personally would never expose a naked var even in these scenarios. -Endre > > Makes sense? > > Jan > > > > >> >> -Endre >> >> On Wed, Jan 20, 2016 at 8:34 PM, Jan Algermissen <[email protected]> >> wrote: >> >>> Hi all, >>> >>> >>> is there a best practice for graceful shutwdown of akka-http Web >>> applications yet? >>> >>> >>> With 'graceful shutdown' I refer to having the server start returning >>> 503 to new requests after receiving SIGTERM but continue processing the >>> existing ones in a grace period. >>> >>> >>> I was thinking about doing this with Akka-Agents: check the agent >>> non-blocking on every request for service status (starting up / running / >>> shutting down) and setting the agent by the startup and shutdown sequence. >>> >>> >>> Aside from agents I cannot really see a useful way to hold the current >>> service status in a single place. Using actors for this seems inappropriate. >>> >>> >>> What do others do / think? >>> >>> >>> Jan >>> >>> -- >>> >>>>>>>>>> Read the docs: http://akka.io/docs/ >>> >>>>>>>>>> Check the FAQ: >>> http://doc.akka.io/docs/akka/current/additional/faq.html >>> >>>>>>>>>> Search the archives: >>> https://groups.google.com/group/akka-user >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "Akka User List" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To post to this group, send email to [email protected]. >>> Visit this group at https://groups.google.com/group/akka-user. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> Akka Team >> Typesafe - Reactive apps on the JVM >> Blog: letitcrash.com >> Twitter: @akkateam >> > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: > http://doc.akka.io/docs/akka/current/additional/faq.html > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- Akka Team Typesafe - Reactive apps on the JVM Blog: letitcrash.com Twitter: @akkateam -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
