Litedb: Question: Recommended Approach for Async Support

Created on 22 May 2018  路  4Comments  路  Source: mbdavid/LiteDB

I would just like to find out the recommended way of implementing async support. I read #124 and im not fully sure if creating a task is the correct approach.

Thanks in advance

Most helpful comment

Hi @AlucardLO, LiteDB works only with native class sync calls. There is no "ReadAsync" or "WriteAsync" method used in FileStream because LiteDB still works with NET35.

If you want/need async task, you must use Task class to encapsulate method call. But I don't know if you will have any advantage. Also, in this case, use a single LiteDatabase instance between threads.

In next v5 version, write operation will run over memory async queue.

All 4 comments

Hi @AlucardLO, LiteDB works only with native class sync calls. There is no "ReadAsync" or "WriteAsync" method used in FileStream because LiteDB still works with NET35.

If you want/need async task, you must use Task class to encapsulate method call. But I don't know if you will have any advantage. Also, in this case, use a single LiteDatabase instance between threads.

In next v5 version, write operation will run over memory async queue.

Thanks for the quick reply @mbdavid

Ill implement v4 so long and once v5 is available I'll swap over.

Hello, any release day planned for v5?

Just wanted to reach out in regards to v5.5 which is planned to include asynchronous support. Will this include asynchronous contexts inside object mappers as well? @mbdavid

Was this page helpful?
0 / 5 - 0 ratings

Related issues

darcome picture darcome  路  3Comments

MoamenMohamed picture MoamenMohamed  路  4Comments

RealBlazeIt picture RealBlazeIt  路  3Comments

manny42 picture manny42  路  3Comments

furesoft picture furesoft  路  4Comments