Hello Everyone,
I would like some help with implementing something in Tryton that works like a blocking queue that multiple modules can make a request (posting) to received back an “access tokens” that is later used to access information from a remote server. Basically, I have a worker that queries a remote server for access token when needed and stores it into the DB so that it can be shared among different modules. The request and storing of this token is done only by this worker only. Eventually the token may expire and needs to be renewed / refreshed but only if it needs to (i.e. there are modules requesting information from the remote server). I know Tryton 5.0 has a queue that uses postgresql listen/notify feature to allow modules to send “requests / tasks” to be handled by a worker. However this queue is non-blocking; for my specific access token use case, I need the module’s token request to block and wait for response from the worker. If the worker has an available token, it will response back to the module quickly; if the token is expired, the worker will have to renew it, hence the rest of the modules must wait until it becomes available.
Can someone point me how can this be implemented in Tryton?
Many thanks in advanced.