On Thu, 16 Jul 2015 20:53:05 GMT, Taylor Gronka wrote:

I want to make use of the Cassandra driver located at
https://github.com/rjmcguire/cassandra-d

I also want to use Vibe's threading. However, when I use both, my program exits with error code -11. I tried to use gdb on the application, but when I run gdb ./test2, I can't load any pages.

I uploaded a simple case to connect to a local cassandra server:
https://github.com/gronka/vibetest01

Since the DB driver code is not thread-safe, you'll have to create one CassandraClient instance per thread. In that case everything should work fine in theory. The simplest approach would be to make the Cassandra variables static. However, you'll have to be careful to not introduce any race-conditions in your own code, too, and use a TaskMutex (or normal Mutex) where appropriate.

It's actually an open issue with vibe.d's HTTPServerOption.distribute that it circumvents the type system and doesn't enforce shared request handlers. Especially for the vibe.web.web interface this needs some thought how to solve it nicely without causing too much disturbance.

I'd be happy to dig into this, but I'm not sure how to get a stack trace or other places to start.

I've also been looking at DataStax's C++ driver for Cassandra. I would like to contribute to cassandra-d since it would be a good exercise in D for me, but the DataStax driver is probably higher quality than I would achieve for quite some time. Would you expect it to be difficult to use that driver in D, or to convert it to a library? I've read a bit about these processes, but I have no idea how hard it might actually be.

Their driver is here:
https://github.com/datastax/cpp-driver

Thanks,

It should basically be portable to D relatively straight forward (well, it's tedious work of course), but, ironically, the fact that it uses asynchronous I/O will make the job harder than it should be (it uses a lot of explicit callbacks/event handlers that are not needed for vibe.d).

Since the protocol is relatively simple, I'd recommend to extend the cassandra-d driver instead. However, the original author doesn't seem to be active anymore, so this might mean taking the maintainership. Maybe it's possible to contact him and move the driver to a GitHub organization.