KenyonY / flaxkv

🗲 A high-performance on-disk dictionary.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

两个python文件,一个写入db,一个读取db,实时读写问题

HanEightTurtle opened this issue · comments

两个python文件,均是通过db = FlaxKV(data_name,root_path_or_url,backend='lmdb')启动db。
file.a写入db,file.b读取db。
file.a通过db['test'] = 'test_value'写入db后,
file.b能够通过db.items()读取到{‘test’:"test_value"},但db.get('test')结果为空。
file.b只能通过db=FlaxKV(...)重新打开db才能使用db.get('test'), pop('test')等。

commented

多进程间调用需要使用客户端的方式
启动服务端

>>> flaxkv run --port 8000

多客户端调用

db = FlaxKV('test_db', root_path_or_url='http://localhost:8000')