I love it, you are talking about something like
from django.conf import settings
So you are looking for a way to have a request microservice configuration
available to a response microservice
OR
to a strategy to handle a session object to fill of whatever in in each
moment (runtime), like in Django we can do with request.session object (as
context object propose in satosa)
Could we store all the proxy/plugins configuration in context object as a
final solution?
I'm a rookie, silly questions just to understand
Il gio 11 lug 2019, 23:41 Rainer Hoerbe <rainer at hoerbe.at> ha scritto:
As Scott pointed out in a separate mail it will not
work between request
and response microservices, however. Actually I did implement a
cookie-based state sharing, but that was before I went on vacation for 3
weeks :-)
I still love the simplicity of getting configurations with a simple import
like with django, but it is not that important for this project.
Cheers, Rainer
Am 2019-07-11 um 23:19 schrieb Giuseppe De Marco <
giuseppe.demarco at unical.it>:
Hi Rainer,
very interesting to me.
The last time I heard Borg pattern was 2010, I'm touched.
It's simply a singleton pattern variation based on an attributes stored in
the class scope.
With your example I understand your proposal and yes, I think that's a
good solution to handle this kind of shared state.
In the past I used a modified singleton to share objects built with the
same arguments:
https://github.com/faif/python-patterns/blob/master/patterns/creational/bor…
this is also a simpler pure-borg example that I found very fun in its
simplicity
https://github.com/faif/python-patterns/blob/master/patterns/creational/bor…
Il giorno gio 11 lug 2019 alle ore 22:10 Rainer Hoerbe <rainer at hoerbe.at>
ha scritto:
We did not have time in the last call to discuss this:
There are use cases where we need to share state between a request and a
response microservice. Now we have already 2 cases, so I suggest to define
a common method to achieve this. The same approach could also be used to
access the common config, e.g. if you need to know the proxy configuration
(such as a backend entityid) in a microservice.
A simple mechanism would be to use a module-level variable as singleton:
=====================
shared_state.py
state = {}
———
plugins/microservices/a.py
from shared_state import state # import executes only once
…
state[’a’] = 'foo'
———
plugins/microservices/b.py
from shared_state import state
whatever(state['a‘])
=====================
I thing that for just passing request status to response microservices
and passing config data around this should be good enough. There are
several alternatives, like the Borg pattern, which I find harder to read.
- Rainer
_______________________________________________
Satosa-dev mailing list
Satosa-dev at lists.sunet.se
https://lists.sunet.se/listinfo/satosa-dev
--
____________________
Dott. Giuseppe De Marco
CENTRO ICT DI ATENEO
University of Calabria
87036 Rende (CS) - Italy
Phone: +39 0984 496961
e-mail: giuseppe.demarco at unical.it
------------------------------------------------------------------------------------------------------------------
Il banner è generato automaticamente dal servizio di posta elettronica
dell'Università della Calabria
<http://www.unical.it/5x1000>
--
------------------------------------------------------------------------------------------------------------------
Il banner è generato automaticamente dal servizio di posta elettronica
dell'Università della Calabria
<http://www.unical.it/5x1000>