Skip to content

Commit ad5c1dc

Browse files
committed
review comments and general session related readme improvement
1 parent 12a42dd commit ad5c1dc

1 file changed

Lines changed: 17 additions & 31 deletions

File tree

‎README.md‎

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ Uninstalling
3838

3939
pip uninstall python-irodsclient
4040

41-
Establishing a (secure) connection
42-
----------------------------------
41+
Establishing a connection
42+
-------------------------
4343

4444
An `iRODSSession` instance is the interface object through which iRODS server
45-
APIs can be invoked. One can create the object using constructor form directly,
45+
APIs can be invoked. One can create the object using the constructor form directly,
4646
passing connection and authentication options within the call parameter list:
4747

4848
```python
@@ -63,18 +63,12 @@ Once created, the `iRODSSession` instance can be managed from a choice between t
6363
possible patterns. Firstly, one can allow references to the instance to persist as
6464
is natural for the application. This allows Python interpreter's reference counting to
6565
let the object pass out of scope and destroy the underlying server connection(s) at the
66-
proper time:
67-
68-
```python
69-
home_coll = session.collections.get(f'/tempZone/home/{session.username}')
70-
# (... Further instances of calls to the server through 'session' may follow.)
71-
```
72-
73-
This casual approach usually ends up being the optimal choice in terms of efficiency, since
74-
connections are expensive to create and destroy, and any given connection to the iRODS
75-
server can be employed consecutively and for disparate purposes without incident.
66+
proper time. This casual approach usually ends up being generally the most efficient one,
67+
as connections are expensive to create and destroy; furthermore, any single connection to
68+
the iRODS server can freely be employed for a number of disparate server interactions,
69+
one after the other.
7670

77-
Alternatively a context manager may be used, thus forcing connections to be
71+
Alternatively, a context manager may be used. This forces all connections to be
7872
provisionally cleared from the session object once a given block of code has
7973
executed:
8074

@@ -85,27 +79,19 @@ with make_session() as session:
8579
# of it, session.cleanup() is implicitly called to remove any idle connections.
8680
```
8781

88-
Either way, the instance remains available for further use afterward, until
82+
Either way, the session instance remains available for further use afterward, until
8983
destructed.
9084

91-
We should, of course, be mindful of how many still-connected `iRODSSession`
92-
objects we retain references to in an application, as having more of them than
93-
the system can support database connections for can result in the spurious failure
94-
of new connections.
95-
96-
Finer points in connecting to the iRODS server
97-
----------------------------------------------
85+
Of course, we should be mindful of how many still-connected `iRODSSession`
86+
objects are allowed to proliferate in an application, since having more client connections
87+
than the server can support database connections for can result in the spurious failure
88+
of any new attempts to connect.
9889

99-
iRODS credentials may also be passed as keyword
100-
arguments:
90+
Basic authentication and security
91+
---------------------------------
10192

102-
```python
103-
>>> from irods.session import iRODSSession
104-
>>> with iRODSSession(host='localhost', port=1247, user='bob', password='1234', zone='tempZone') as session:
105-
... # workload
106-
...
107-
>>>
108-
```
93+
As seen in the `iRODSSession` constructor call in the previous section, iRODS credentials may be passed
94+
in as keyword arguments.
10995

11096
If you're an administrator acting on behalf of another user:
11197

0 commit comments

Comments
 (0)