// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using System.Collections.Concurrent;
using System.Threading;
namespace FASTER.core
{
///
/// Async IO context for PMM
///
public unsafe struct AsyncIOContext
{
///
/// Id
///
public long id;
///
/// Key
///
public IHeapContainer request_key;
///
/// Retrieved key
///
public Key key;
///
/// Retrieved value
///
public Value value;
///
/// Logical address
///
public long logicalAddress;
///
/// Record buffer
///
public SectorAlignedMemory record;
///
/// Object buffer
///
public SectorAlignedMemory objBuffer;
///
/// Callback queue
///
public BlockingCollection> callbackQueue;
///
/// Dispose
///
public void Dispose()
{
// Do not dispose request_key as it is a shallow copy
// of the key in pendingContext
record.Return();
}
}
internal class SimpleReadContext : IAsyncResult
{
public long logicalAddress;
public SectorAlignedMemory record;
public SemaphoreSlim completedRead;
public object AsyncState => throw new NotImplementedException();
public WaitHandle AsyncWaitHandle => throw new NotImplementedException();
public bool CompletedSynchronously => throw new NotImplementedException();
public bool IsCompleted => throw new NotImplementedException();
}
}