vesoft-inc / nebula-python

Client API of Nebula Graph in Python
193 stars 78 forks source link

Is the connection of 2.0 thread safe? #109

Closed ownthink closed 3 years ago

ownthink commented 3 years ago

nebula 2.0的连接是否是线程安全的?

Aiee commented 3 years ago

The connection is not thread-safe, though the connection pool is thread-safe.

ownthink commented 3 years ago

我记得1.0是加锁的,2.0是否可以处理下呢

wey-gu commented 3 years ago

我记得1.0是加锁的,2.0是否可以处理下呢

If you use connection_pool, it comes with a lock already

ref: https://github.com/vesoft-inc/nebula-python/blob/master/nebula2/gclient/net/__init__.py

ownthink commented 3 years ago

不用pool的是否可以加锁下呢

 

------------------ 原始邮件 ------------------ 发件人: "vesoft-inc/nebula-python" @.>; 发送时间: 2021年5月26日(星期三) 下午2:48 @.>; @.**@.>; 主题: Re: [vesoft-inc/nebula-python] nebula 2.0的连接是否是线程安全的? (#109)

我记得1.0是加锁的,2.0是否可以处理下呢

If you use connection_pool, it comes with a lock already

ref: https://github.com/vesoft-inc/nebula-python/blob/master/nebula2/gclient/net/__init__.py

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

laura-ding commented 3 years ago

不用pool的是否可以加锁下呢   ------------------ 原始邮件 ------------------ 发件人: "vesoft-inc/nebula-python" @.>; 发送时间: 2021年5月26日(星期三) 下午2:48 @.>; @.**@.>; 主题: Re: [vesoft-inc/nebula-python] nebula 2.0的连接是否是线程安全的? (#109) 我记得1.0是加锁的,2.0是否可以处理下呢 If you use connection_pool, it comes with a lock already ref: https://github.com/vesoft-inc/nebula-python/blob/master/nebula2/gclient/net/__init__.py — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

You can look at this PR https://github.com/vesoft-inc/nebula-python/pull/67. See if it meets your needs

ownthink commented 3 years ago

目前安装的这个版本,是否可以更新下pip image

laura-ding commented 3 years ago

目前安装的这个版本,是否可以更新下pip image

pip install nebula2-python==2.0.0

ownthink commented 3 years ago

thk

laura-ding commented 3 years ago

Problem resolved, so close it.