Akka Futures 内で tinkerpop を使用できるかどうかを知りたいのですが、これまでのところ、変更をグラフにコミットしても保持されません。tinkerpop はスレッド ローカル ライブラリであることを理解しています。つまり、将来的にスレッドを再度設定する必要があるということです。ODatabaseRecordThreadLocal.INSTANCE.set(thread)
成功せずに次の方法を試しました:
def test[T](graphChanges: => T): T = {
val thread = ODatabaseRecordThreadLocal.INSTANCE.get
try graphChanges finally {
ODatabaseRecordThreadLocal.INSTANCE.set(thread)
GraphPool.get("partitioned").commit
}
}
// collect tinkerpop frames
test {
future {
// add changes to my tinkerpop frames
}
}
play.mvc.Http.Context ごとに Tinkerpop スレッドを使用したいと思います
これが私が達成したいサンプルプロジェクトです: https://github.com/D-Roch/tinkerpop-play