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

Experimental async support #629

Merged
merged 7 commits into from Dec 21, 2021
Merged

Experimental async support #629

merged 7 commits into from Dec 21, 2021

Conversation

robsdedude
Copy link
Member

@robsdedude robsdedude commented Dec 10, 2021

#180

Working on experimental* support for asyncio.

*experimental: it might be removed or change it's API at any time (including patch releases).

Copy link
Contributor

@fbiville fbiville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor things

.editorconfig Outdated
[*.{py,js,rst,txt,sh,bat}]
trim_trailing_whitespace = true

[{Makefile,Drockerfile}]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[{Makefile,Drockerfile}]
[{Makefile,Dockerfile}]

.editorconfig Outdated
trim_trailing_whitespace = true

[*.bat]
end_of_line =crlf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
end_of_line =crlf
end_of_line = crlf

- batch
- id: trailing-whitespace
args: [ --markdown-linebreak-ext=md ]
# - repo: https://github.com/pycqa/flake8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you need to keep this one around?

CHANGELOG.md Outdated
@@ -4,7 +4,10 @@

- Python 3.10 support added
- Python 3.6 support has been dropped.

- `Result`, `Session`, and `Transaction`, can no longer be imported from
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `Result`, `Session`, and `Transaction`, can no longer be imported from
- `Result`, `Session`, and `Transaction` can no longer be imported from

CONTRIBUTING.md Outdated
# or
$ pre-commit run --file path/to/a/file
```
For more details see [flake8](https://flake8.pycqa.org/).
Copy link
Contributor

@fbiville fbiville Dec 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flake8 is currently disabled in the hook, are these instructions still relevant?

*********************************
AsyncSessions & AsyncTransactions
*********************************
All database activity is co-ordinated through two mechanisms: the :class:`neo4j.AsyncSession` and the :class:`neo4j.AsyncTransaction`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
All database activity is co-ordinated through two mechanisms: the :class:`neo4j.AsyncSession` and the :class:`neo4j.AsyncTransaction`.
All database activity is coordinated through two mechanisms: the :class:`neo4j.AsyncSession` and the :class:`neo4j.AsyncTransaction`.


A :class:`neo4j.AsyncSession` is a logical container for any number of causally-related transactional units of work.
Sessions automatically provide guarantees of causal consistency within a clustered environment but multiple sessions can also be causally chained if required.
Sessions provide the top-level of containment for database activity.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing word after "top-level" or extra hyphen?

# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# http://www.apache.org/licenses/LICENSE-2.0
# https://www.apache.org/licenses/LICENSE-2.0

it would be nice to apply this change everywhere

# Carry out Bolt subclass imports locally to avoid circular dependency issues.
from ._bolt3 import AsyncBolt3
from ._bolt4 import (
AsyncBolt4x0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there really a need for an async variant of these?

sent to the network, and a response is fetched.

:param database: database for which to fetch a routing table
:param imp_user: the user to impersonate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add that it is only supported for Neo4j 4.4+

robsdedude and others added 3 commits December 20, 2021 17:49
@robsdedude robsdedude changed the title Async... maybe Experimental async support Dec 21, 2021
@robsdedude robsdedude merged commit 0f53077 into neo4j:5.0 Dec 21, 2021
@robsdedude robsdedude deleted the async branch December 21, 2021 13:07
@Joshuaalbert
Copy link

@robsdedude How experimental is async in neo4j now?

@robsdedude
Copy link
Member Author

@Joshuaalbert 🤔 I'd say it's very likely to stay (still no guarantee). There are a hand full of smaller bugs in the preview release (5.0.0a1) which won't receive a released fix until the actual 5.0 alpha (with 5.0 features and API changes) goes out (probably in a few months from now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants