[julia-users] Escher global and local context

2016-01-31 Thread Leonardo
Hi all, I want write an application with a Web UI (e.g. a chat) that has a local state (specific for each client) and global one (a state bind to web server). These requirements are useful for example to permit communications between different client (e.g. into a chat) and/or handle centralized

Re: [julia-users] Escher global and local context

2016-01-31 Thread Shashi Gowda
Hi Leonardo If you have a single Escher process serving multiple requests and you want to share some state between them, my recommendation would be to put the shared data in signal, which can optionally be persisted to disk/DB something like if !isdefined(:my_global_var) # this condition makes s

Re: [julia-users] Escher global and local context

2016-01-31 Thread Shashi Gowda
On Sun, Jan 31, 2016 at 11:41 PM, Shashi Gowda wrote: > Hi Leonardo > > put the shared data in signal, which can optionally be persisted to disk/DB > I meant to say "put the shared data in a global signal"

Re: [julia-users] Escher global and local context

2016-02-01 Thread Leonardo
Hi Shashi, this technique is applicable also for non-Signal variables, right? However, persistence hints for Signals are very interestings ... Thanks Leonardo Il 31/01/2016 19:11, Shashi Gowda ha scritto: Hi Leonardo If you have a single Escher process serving multiple requests and you want

Re: [julia-users] Escher global and local context

2016-02-01 Thread Shashi Gowda
Yes this is how you can share non signal variables as well. However, if you use a non-signal variable to share state, your state updates will not be propagated across clients one the main function has executed. If you persist state like in the example, you can load it and make it the initial value

Re: [julia-users] Escher global and local context

2016-03-06 Thread Leonardo
Hello, I return on this argument, but with a different question. If I need allocate a local (per connected client) resource, I can create it into main(); but how can deallocate it (the problem is strictly related to handling of session, as expressed at https://groups.google.com/forum/#!searchi