Make Client thread-safe & add docs #495

Merged
6543 merged 6 commits from :doc-concurrency into master 8 months ago
noerw commented 8 months ago

fix #494

fix #494
noerw added 1 commit 8 months ago
c0e50a6b46
docs: mention thread-safeness
6543 added 1 commit 8 months ago
7084a556a9
use mutex
6543 changed title from docs: mention Client thread-safeness to Make Client thread-safe & add docs 8 months ago
6543 added the
kind/docs
label 8 months ago
6543 added 1 commit 8 months ago
969df574f9
simplify & finish
6543 added the
kind/enhancement
label 8 months ago
6543 added this to the v0.14.0 milestone 8 months ago
6543 added 1 commit 8 months ago
6e7f81a3a6
get client ref within thread-save code
6543 approved these changes 8 months ago
Dismissed
Poster

lgtm

lgtm
Owner

We could add -race flag on ci test and also add a test with two goroutines to use the client.

We could add -race flag on ci test and also add a test with two goroutines to use the client.
Collaborator
@lunny @jolheiser we already do! https://gitea.com/gitea/go-sdk/src/branch/master/Makefile#L77
6543 added 1 commit 8 months ago
308a9e73ca
same with c.debug
6543 added 1 commit 8 months ago
1b45e79cf6
find posible race cond outside client.go
6543 approved these changes 8 months ago
Dismissed
6543 left a comment

this should it finaly be :O

zeripath approved these changes 8 months ago
Dismissed
zeripath left a comment

OK I think this is right.

It might be helpful to extract a small core struct that has the functions that use internal fields and hence need to be locked.

That way you can be sure that the locking is correct - at present there are so so many functions that ensuring that they are always safe will be hard.

6543 merged commit ff82113459 into master 8 months ago
6543 referenced this issue from a commit 8 months ago
6543 deleted branch doc-concurrency 8 months ago
continuous-integration/drone/pr Build is passing
The pull request has been merged as ff82113459.
Sign in to join this conversation.
Loading…
There is no content yet.