public static Task<IFdbClusterHandler> CreateClusterAsync(string clusterFile, CancellationToken cancellationToken) { var future = FdbNative.CreateCluster(clusterFile); return FdbFuture.CreateTaskFromHandle(future, (h) => { ClusterHandle cluster; var err = FdbNative.FutureGetCluster(h, out cluster); if (err != FdbError.Success) { cluster.Dispose(); throw Fdb.MapToException(err); } var handler = new FdbNativeCluster(cluster); return (IFdbClusterHandler) handler; }, cancellationToken ); }
public static Task <IFdbClusterHandler> CreateClusterAsync(string clusterFile, CancellationToken ct) { var future = FdbNative.CreateCluster(clusterFile); return(FdbFuture.CreateTaskFromHandle(future, (h) => { var err = FdbNative.FutureGetCluster(h, out ClusterHandle cluster); if (err != FdbError.Success) { cluster.Dispose(); throw Fdb.MapToException(err); } var handler = new FdbNativeCluster(cluster); return (IFdbClusterHandler)handler; }, ct )); }