Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] on_startup & on_shutdown signals example with aiopg engine #2195

Closed
wants to merge 175 commits into from
Closed

[Doc] on_startup & on_shutdown signals example with aiopg engine #2195

wants to merge 175 commits into from

Conversation

panagiks
Copy link
Contributor

What do these changes do?

Add a documentation example usage of on_startup and on_shutdown signals by properly creating and disposing an aiopg connection engine.

Are there changes in behavior for the user?

No, just documentation.

Related issue number

Relates to #2131.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the changes folder
    • name it <issue_id>.<type> for example (588.bug)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

asvetlov and others added 30 commits June 20, 2017 14:42
* Improvement for normalize_path_middleware. Now it could handle URLs with query string

* Pull request number.
* Fix couple tests

* Another test

* Fix last tests

* Pin multidict requirement to 3.0.0

* Fix tests

* Make test stable
* Adopt towncrier

* Add missing files

* Mention itself in changes

* Fix settings

* Adopt CHANGES formatting to towncrier generator

* Change title format

* Fix title level consistency
Raise `RedirectURLError` if a redirect response has
no Location or URI HTTP header.
Close #2009
asvetlov and others added 23 commits July 29, 2017 18:25
* Fix #2123: User request instead of message in access logger

* Doc update

* Optimize request.host property

* Introduce BaseRequest.remote property

* Fix spelling errors

* Add tests
* Throttle simultaneous DNS requests

Added a new option at TCPConnector level called `throttle_dns` that
allows to the connector throttle simulatnewous DNS requests for a specific
domain. This functionality its only compatible when the DNS cache is
enabled and it is dissabled by default. Therefore,  many requests can
end up making the same DNS resolution.

* Explicit loop for sleep calls

* Fixed typos in documentation

* Added DNS request throttling in CHANGES.rst

* Dogpile invalid word by doc-spelling

* Get full coverage for locks

* Throttle DNS always enabled

Will help the user to throttle DNS requests to the same domain. By
design it will happen always when many URLs behind the same domain are
scheduled at the same time, perhaps via *gather*

The Event class is no longer a derivated class of the
asyncio.locks.Event, and makes a full copy of this one to avoid future
issues.

* Remove implicit loop tests for locks.Event

* Use create_future helper

* Updated spelling wordlist

* Use a simple Event wrapper instead of a full Event class implementation

* Pass the loop explicitly

* Cancel pending throttled DNS requests if connector is close

* Removed not used attribute

* Pass loop explicit

* Throtlle DNS feature adapted to CHANGES protocol

* Update 2111.feature

* Changed class name
* use osx postgres user

* Create 2149.misc
* Update pytest from 3.1.3 to 3.2.0

* Update pytest from 3.1.3 to 3.2.0
* First scratches

* Work on

* Work on decorators

* Make examples work

* Refactor

* sort modules for scanning

* Go forward

* Add tests

* Add test for decoration methods

* Add missing file

* Fix python 3.4, add test

* Fix typo

* Implement RouteDef

* Test cover

* RouteDef -> RoutesDef

* RouteInfo -> RouteDef

* Add couple TODOs, drop RouteDef from exported names

* Fix flake8 blame

* RoutesDef -> RouteTableDef

* Add reprs

* Add changes record

* Test cover missed case

* Add documentation for new route definitions API in web reference

* Fix typo

* Mention route tables and route decorators in web usage

* Text flow polishing

* Fix typo
* add StaticResource.url append_version arg

* add 2157.feature

* 2157.feature contributor

* sort contributors.txt

* add documentation for StaticResource.url_for append_version arg #2157

* update read file code to be compatible with windows python 3.4

* fix flake8 line len issues

* add append_version param to StaticResource constructor and add_static method
docs and tests is updated to reflect changes

* add more tests and docs for StaticRoute append_version

* removed outdated comments

* add ValueError exception catching for follow_symlinks and more tests
… (#2169)

* Deprecated BaseRequest.has_body, replaced with 2 new attributes

* Test obsolete BaseRequest.has_body attr
This fixes #2170 by parsing Forwarded more carefully, while staying about
as fast, simple, and robust in the face of potential injection attacks.
(Speed was measured with IPython's %timeit on my laptop on a few typical
and pathological header values.)

In particular:

- commas and semicolons are allowed inside quoted-strings;
- empty forwarded-pairs (as in "for=_1;;by=_2") are allowed;
- non-standard parameters are allowed (although this alone could be easily
  done in the previous parser).

This still doesn't parse valid headers containing obs-text, which was
an intentional decision in the previous parser (see comments) that I did
not change.

Also, the previous parser used to bail out of forwarded-elements containing
duplicate parameter names. No rationale was given in the code, and I don't
think this is important, so the new parser doesn't enforce this.
* use trafaret.IP

* Create 2187.misc
@panagiks
Copy link
Contributor Author

Sorry .... wrong branch

@panagiks panagiks closed this Aug 13, 2017
@codecov-io
Copy link

codecov-io commented Aug 13, 2017

Codecov Report

Merging #2195 into 2.2 will increase coverage by 0.08%.
The diff coverage is 97.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##              2.2    #2195      +/-   ##
==========================================
+ Coverage   97.06%   97.15%   +0.08%     
==========================================
  Files          38       39       +1     
  Lines        7691     7895     +204     
  Branches     1341     1367      +26     
==========================================
+ Hits         7465     7670     +205     
+ Misses        102      100       -2     
- Partials      124      125       +1
Impacted Files Coverage Δ
aiohttp/web_server.py 100% <ø> (ø) ⬆️
aiohttp/http_writer.py 94.52% <ø> (+0.94%) ⬆️
aiohttp/client_proto.py 91.66% <ø> (ø) ⬆️
aiohttp/web.py 99.65% <ø> (ø) ⬆️
aiohttp/formdata.py 98.82% <100%> (ø) ⬆️
aiohttp/streams.py 98.75% <100%> (+0.5%) ⬆️
aiohttp/helpers.py 97.32% <100%> (+0.17%) ⬆️
aiohttp/web_request.py 99.68% <100%> (+0.74%) ⬆️
aiohttp/connector.py 97.65% <100%> (+0.07%) ⬆️
aiohttp/payload.py 98.86% <100%> (+0.04%) ⬆️
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cc2a522...cd207cf. Read the comment docs.

@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bot:chronographer:provided There is a change note present in this PR outdated
Projects
None yet
Development

Successfully merging this pull request may close these issues.