6 releases (breaking)

0.5.0 May 20, 2023
0.4.0 Mar 16, 2023
0.3.0 Oct 2, 2022
0.2.0 Mar 3, 2022
0.1.0 Aug 25, 2020

#245 in Concurrency

Download history 13/week @ 2023-02-11 16/week @ 2023-02-18 5/week @ 2023-03-04 22/week @ 2023-03-11 10/week @ 2023-03-18 31/week @ 2023-03-25 14/week @ 2023-04-01 19/week @ 2023-04-08 33/week @ 2023-04-15 4/week @ 2023-04-22 12/week @ 2023-04-29 20/week @ 2023-05-06 10/week @ 2023-05-13 34/week @ 2023-05-20 9/week @ 2023-05-27

73 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

~10MB
~268K SLoC