swat.CAS.fork

CAS.fork(self, num=2)

Create multiple copies of a connection

The copies of the connection will use the same parameters as self, but each will create a new session.

Parameters
numint, optional

Number of returned connections. The first element of the returned list is always the object that the fork method was called on.

Returns
list of CAS objects

See also

copy()

Notes

The first element in the returned list is the same object that the method was called on. You only get num-1 copies.

Examples

The code below demonstrates how to get four unique connections.

>>> conn = swat.CAS()
>>> c1, c2, c3, c4 = conn.fork(4)
>>> c1 is conn
True
>>> c2 is conn
False