github3py 是线程安全的吗?
Is github3py thread-safe?
有谁知道 github3py 是否是线程安全的。
具体来说:
- GitHub.repository()
- Repository.iter_pulls()
- Repository.branch()
- Repository.create_status()
None 个线程编辑对象,只需共享实例并调用方法。
谢谢
如 github3py's Readme 中所述,requests
库在后台使用。更具体地说,github3py 中的每个对象都有一个 _session
属性,它是一个 requests.Session
对象。
在requests documentation, thread-safety is listed among the supported features. However, this issue and this issue状态下,在某些情况下,Session 对象不是线程安全的。所以,要小心! :)
为了给你一个更彻底的答案,Aviv,既然你只是共享实例和调用方法,那么它绝对是线程安全的。请求线程安全的一些问题主要是关于 cookie、它们的过期和它们的撤销。 github3.py 不使用 Cookie 与 GitHub API 交谈,所以你应该没问题。
有谁知道 github3py 是否是线程安全的。
具体来说:
- GitHub.repository()
- Repository.iter_pulls()
- Repository.branch()
- Repository.create_status()
None 个线程编辑对象,只需共享实例并调用方法。
谢谢
如 github3py's Readme 中所述,requests
库在后台使用。更具体地说,github3py 中的每个对象都有一个 _session
属性,它是一个 requests.Session
对象。
在requests documentation, thread-safety is listed among the supported features. However, this issue and this issue状态下,在某些情况下,Session 对象不是线程安全的。所以,要小心! :)
为了给你一个更彻底的答案,Aviv,既然你只是共享实例和调用方法,那么它绝对是线程安全的。请求线程安全的一些问题主要是关于 cookie、它们的过期和它们的撤销。 github3.py 不使用 Cookie 与 GitHub API 交谈,所以你应该没问题。