Skip to content

Experimental async support - #629

Merged
robsdedude merged 7 commits into
neo4j:5.0from
robsdedude:async
Dec 21, 2021
Merged

robsdedude merged 7 commits into
neo4j:5.0from
robsdedude:async

Conversation

@robsdedude

@robsdedude robsdedude commented Dec 10, 2021 •

Copy link
Copy Markdown
Member

#180

Working on experimental* support for asyncio.

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

@robsdedude
robsdedude force-pushed the async branch 6 times, most recently from fd7e654 to 11de5b8 Compare December 15, 2021 09:09

@fbiville fbiville left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

minor things

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

[{Makefile,Drockerfile}]

Copy link
Copy Markdown
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}]

Comment thread .editorconfig Outdated
trim_trailing_whitespace = true

[*.bat]
end_of_line =crlf

Copy link
Copy Markdown
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

Comment thread .pre-commit-config.yaml Outdated
- batch
- id: trailing-whitespace
args: [ --markdown-linebreak-ext=md ]
# - repo: https://github.com/pycqa/flake8

Copy link
Copy Markdown
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?

Comment thread CHANGELOG.md Outdated
- Python 3.10 support added
- Python 3.6 support has been dropped.

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

Copy link
Copy Markdown
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

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

@fbiville fbiville Dec 20, 2021 •

Copy link
Copy Markdown
Contributor

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?

Comment thread docs/source/async_api.rst
*********************************
AsyncSessions & AsyncTransactions
*********************************
All database activity is co-ordinated through two mechanisms: the :class:`neo4j.AsyncSession` and the :class:`neo4j.AsyncTransaction`.

Copy link
Copy Markdown
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`.

Comment thread docs/source/async_api.rst Outdated

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
Copy Markdown
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?

Comment thread neo4j/_async/driver.py
# 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
Copy Markdown
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

Comment thread neo4j/_async/io/_bolt.py
# Carry out Bolt subclass imports locally to avoid circular dependency issues.
from ._bolt3 import AsyncBolt3
from ._bolt4 import (
AsyncBolt4x0,

Copy link
Copy Markdown
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?

Comment thread neo4j/_async/io/_bolt.py
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
Copy Markdown
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
robsdedude force-pushed the async branch 2 times, most recently from bed5142 to 9aff556 Compare December 20, 2021 15:43
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
Copy Markdown

@robsdedude How experimental is async in neo4j now?

@robsdedude

Copy link
Copy Markdown
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.

3 participants