11-18-2022 11:18 AM
Hey.
I'm having a first look at 6.0. I noticed Pool and PoolConfig in pyapi. It is extremely, for the lack of better word, economically documented. So, at first glance I saw what I wanted to see, a resource-manager type of a thing. After greping around for a while it doesn't seem that though.
I'm curious, what is this?
Solved! Go to Solution.
11-20-2022 09:04 PM
The ncs.pool has been around, and documented, for some time, NSO 4.5 (2017). It was introduced to allow the Python API to execute Services and Actions using ThreadPool and to have Service/NanoService no longer use self.maapi (not thread safe), and instead, use a pool of maapi objects.
The source code can be found under $NCS_DIR/src/ncs/pyapi/pysrc/pool.py. It is designed for Python API use cases, which is the reason for the "economic" documentation. See $NCS_DIR/src/ncs/pyapi/ncs/application.py for an example of how it is used to store maapi connections.
11-20-2022 09:04 PM
The ncs.pool has been around, and documented, for some time, NSO 4.5 (2017). It was introduced to allow the Python API to execute Services and Actions using ThreadPool and to have Service/NanoService no longer use self.maapi (not thread safe), and instead, use a pool of maapi objects.
The source code can be found under $NCS_DIR/src/ncs/pyapi/pysrc/pool.py. It is designed for Python API use cases, which is the reason for the "economic" documentation. See $NCS_DIR/src/ncs/pyapi/ncs/application.py for an example of how it is used to store maapi connections.
11-20-2022 11:55 PM
Thank you for the explanation.
"""Resource Pool""" is just a little too ambiguous together with the rest of docstrings in that particular module. Perhaps something like """Resource/Thread Pool for MAAPI objects"""; thing gets pulled into the HTML API by the doc generator, user like me sees it, gets the idea and doesn't nag the devs on the forum.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: