cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
251
Views
10
Helpful
2
Replies

Module ncs.pool - what is this?

u.avsec
Beginner
Beginner

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?

1 Accepted Solution

Accepted Solutions

cohult
Cisco Employee
Cisco Employee

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.

View solution in original post

2 Replies 2

cohult
Cisco Employee
Cisco Employee

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.

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.

Getting Started

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:

Recognize Your Peers