You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the time being, most of gnet.Conn's methods are not concurrency-safe, which may result in some inconvenience and limitations, or performance issues like #423. Hence, I'd like to investigate the possibility of introducing the synchronization mechanism for gnet.Conn.
Scenarios for new feature
Any scenarios where gnet.Conn is required to be used in goroutines outside the event loop will benefit from this new feature.
Breaking changes or not?
No
Code snippets (optional)
What I have in mind at the moment is something like this:
typeOptionsstruct {
...// Locker will be utilized as a synchronization to ensure the concurrent safety of the gnet.Conn.Locker sync.Locker
}
funcWithLocker(locker sync.Locker) Option {
returnfunc(opts*Options) {
opts.Locker=locker
}
}
This is just an initial idea, it's not necessarily the final implementation.
Alternatives for new feature
We can also do this internally without exposing any new APIs, which might be more straightforward but less flexiable.
Additional context (optional)
None.
The text was updated successfully, but these errors were encountered:
Description of new feature
For the time being, most of
gnet.Conn
's methods are not concurrency-safe, which may result in some inconvenience and limitations, or performance issues like #423. Hence, I'd like to investigate the possibility of introducing the synchronization mechanism forgnet.Conn
.Scenarios for new feature
Any scenarios where
gnet.Conn
is required to be used in goroutines outside the event loop will benefit from this new feature.Breaking changes or not?
No
Code snippets (optional)
What I have in mind at the moment is something like this:
This is just an initial idea, it's not necessarily the final implementation.
Alternatives for new feature
We can also do this internally without exposing any new APIs, which might be more straightforward but less flexiable.
Additional context (optional)
None.
The text was updated successfully, but these errors were encountered: