becls/swish

Question: How to use my wiredtiger database library

amirouche opened this issue ยท 4 comments

Hello,

I am (re) starting a project that I have done previously using Guile where I planned to use guile-fibers. Maybe swish can do the job.

I have a database library built on top of wireditger which is a database library that is hosted in the process that uses it.

So, my question is, can make use of the database library without having to use another process and serialize queries over the wire.

Thanks in advance!

So you're planning to integrate the wiredtiger library into the Scheme process? If so, you'll need to write some glue code, especially if wiredtiger does not support an asynchronous interface. The glue code would manage the threads needed by wiredtiger and marshal the queries and results from and to the Scheme main thread. See src/swish/sqlite.c for an example of using the SQLite library from Scheme.

you're planning to integrate the wiredtiger library into the Scheme process?

Yes, I want to use wiredtiger in the same process.

you'll need to write some glue code, especially if wiredtiger does not support an asynchronous interface

It does have an async interface but I am not familiar with it.

See src/swish/sqlite.c for an example of using the SQLite library from Scheme.

I was expecting a scheme solution, not C. Anyway, I will study that code.

What I was expecting, is something that allows me to execute some blocking operation in another thread and unpause the mainthread coroutine (?) when that blocking operation is finished, returning the result of the procedure that was executed in the other thread. Preferably, using a threadpool.

The Scheme code runs single threaded. Consequently, if a blocking operation is required, it must be done on another thread, and the result sent back to the Scheme main thread.

Maybe I will re-open the issue later, if I decide to go with swish. Tx!