FASTER
FASTER copied to clipboard
Read uncommitted data
Currently, FASTER doesn't allow to read uncommitted data by ReadAsync method. In the same time, iterator allows to do that. Is this possible to extend ReadAsync accordingly?
ClientSession can be used like so:
var session = _store.For(new SimpleFunctions<byte[], byte[]>()).NewSession<SimpleFunctions<byte[], byte[]>>()
var (status, output) = session.Read(key);
byte[]? value = null;
if (status.Found)
value = output;
if (status.IsPending && session.CompletePendingWithOutputs(out var iter, true, true))
{
using (iter)
{
while (iter.Next())
{
if (iter.Current.Key.AsSpan().SequenceEqual(key))
{
value = iter.Current.Output;
break;
}
}
}
}
👍