Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Async support?#1330

znd4 started this conversation inIdeas
Aug 25, 2021· 2 comments· 2 replies
Discussion options

I have no idea how much work would be required to implement this, but it'd be awesome to be able to

awaitRepo.clone_from(url,path)

(or something similar -- it's not the end of the world if it has to be a separate method):

awaitRepo.async_clone_from(url,path)

I just read the blurb about the status of this project, so totally get that this would only be unlikely to be implemented without an enterprising contributor.

I googled my way toasyncio.create_subprocess_exec, so it's definitelypossible, but it seems like it'd be a ton of work to maintain async and non-async interfaces for everything, so I could understand if you'd rather not accept this as a contribution

You must be logged in to vote

Replies: 2 comments 2 replies

Comment options

I googled my way to asyncio.create_subprocess_exec, so it's definitely possible, but it seems like it'd be a ton of work to maintain async and non-async interfaces for everything, so I could understand if you'd rather not accept this as a contribution

Thanks for bringing this up - there is no doubt a use for this in async codebases, but the cost of maintaining that seems too high even with such an enterprising contributor.

If there is some potential in this regard, are there ways in python to 'asyncify` otherwise blocking code to make it flow better in async code bases or make it more composable? If so, this might be wroth a contribution to the documentation along the lines of 'GitPython and async'.

You must be logged in to vote
0 replies
Comment options

the cost of maintaining that seems too high

@Byron Can you elaborate on that? This seems like an ideal library for async as it's very io bound and synchronous functions can call async functions, so (as I understand it) it wouldn't be a matter of maintaining both, just porting all the io to async calls.

You must be logged in to vote
2 replies
@Byron
Comment options

Since GitPython is in maintenance mode, making such a breaking change is nothing that I'd include in the timeline, only bugfixes are made along with the occasional contributed feature.

Thanks for your understanding.

@lionel-panhaleux
Comment options

@ahonnecke can I suggest usingasgiref?

awaitasgiref.sync.SyncToAsync(git.Repo.clone_from)(url,path)

I this work for you, it looks to me like this could be a simple doc contribution.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Ideas
Labels
None yet
4 participants
@znd4@Byron@ahonnecke@lionel-panhaleux
Converted from issue

This discussion was converted from issue #1329 on August 26, 2021 01:11.


[8]ページ先頭

©2009-2025 Movatter.jp