8 releases (breaking)

0.7.0 Jun 25, 2024
0.6.0 Oct 28, 2023
0.5.0 May 20, 2023
0.4.0 Mar 16, 2023
0.1.0 Aug 25, 2020

#227 in Concurrency

Download history 1/week @ 2024-03-27 6/week @ 2024-04-03 109/week @ 2024-04-10 3/week @ 2024-05-29 7/week @ 2024-06-05 2/week @ 2024-06-12 99/week @ 2024-06-19 41/week @ 2024-06-26 74/week @ 2024-07-03

215 downloads per month

MIT/Apache

5KB

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.


lib.rs:

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.

Dependencies

~9MB
~239K SLoC