Skip to content

Rust tlrepo crate: Thread-local git2::Repository, shareable across threads

Notifications You must be signed in to change notification settings

joshtriplett/tlrepo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tlrepo provides ThreadLocalRepo, a convenient way to share a git2::Repository object between threads.

A standard git2::Repository object does not support sharing among threads without some form of synchronization. tlrepo::ThreadLocalRepo provides a convenient way to reopen the same repository on each thread, caching the opened repository thread-locally for reuse.

You can create a ThreadLocalRepo by calling ThreadLocalRepo::new, or by using the extension trait tlrepo::RepositoryExt to call .thread_local() on an existing git2::Repository. You can share the ThreadLocalRepo across threads, calling .get() to get a git2::Repository object to work with.

About

Rust tlrepo crate: Thread-local git2::Repository, shareable across threads

Resources

Stars

Watchers

Forks

Sponsor this project

 

Languages