Create a new session, add it to the pool and return it.
(self)
| 227 | await self._state.reset() |
| 228 | |
| 229 | async def _create_new_session(self) -> Session: |
| 230 | """Create a new session, add it to the pool and return it.""" |
| 231 | if self._create_session_function: |
| 232 | new_session = self._create_session_function() |
| 233 | else: |
| 234 | new_session = Session(**self._session_settings) |
| 235 | self._state.current_value.sessions[new_session.id] = new_session |
| 236 | return new_session |
| 237 | |
| 238 | async def _fill_sessions_to_max(self) -> None: |
| 239 | """Fill the pool with sessions to the maximum size.""" |
no test coverage detected