Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
silkaj
silkaj
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 153
    • Issues 153
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 5
    • Merge Requests 5
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • clients
  • python
  • silkajsilkaj
  • Issues
  • #321

Closed
Open
Opened Jun 02, 2020 by Moul@moulOwner

Implement the `with` usage on a network client

Follow up of #210 (closed)

That would be great if we could use a connection with the with statement as for opening a file. This would avoid many issues. In particular with tests, and in the code where we have to be handle to close the client session in every exit edge cases, not to get a stacktrace on properly close a session.

Creating a function out of @contextlib.asynccontextmanager would be very nice.

May be this could be introduced in DuniterPy as a helper.

  • StackOverFlow reference
Edited Dec 13, 2020 by Moul
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
0.9.0
Milestone
0.9.0
Assign milestone
Time tracking
None
Due date
None
Reference: clients/python/silkaj#321