本文整理汇总了C#中CarbonClient.GetFrameAsync方法的典型用法代码示例。如果您正苦于以下问题:C# CarbonClient.GetFrameAsync方法的具体用法?C# CarbonClient.GetFrameAsync怎么用?C# CarbonClient.GetFrameAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CarbonClient
的用法示例。
在下文中一共展示了CarbonClient.GetFrameAsync方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
/// <summary>
/// Retrieves the list of RIC chain configuration pieces from carbon dataframes. Will throw an exception if nothing at all is returned, because
/// we don't want empty lists being uploaded to datascope as a result of a failure to retrieve the dataframe
/// </summary>
/// <param name="cc_"></param>
/// <param name="forceRefresh_"></param>
/// <returns></returns>
public static async Task<IEnumerable<FutureChainSetup>> Read(CarbonClient cc_, bool forceRefresh_ = false)
{
if (_list != null && !forceRefresh_)
return _list;
var frame = await cc_.GetFrameAsync<int>(DF_MONIKER);
if (frame == null)
{
SLog.log.Error(string.Format("Failed to retrieve dataframe from Carbon with moniker [{0}]", DF_MONIKER));
return null;
}
_list = frame.ToRecords<FutureChainSetup>().ToList();
if (!_list.Any())
{
_list = null;
throw new Exception(string.Format(
"Could not retrieve dataframe [{0}] from carbon to configure lists of futures", DF_MONIKER));
}
return _list;
}
示例2: GetGmtDatesFromCarbon
public async Task<DateTime[]> GetGmtDatesFromCarbon(CarbonClient client_)
{
var deedle = await client_.GetFrameAsync<int>(getDatesMoniker());
if (deedle == null) return null;
var recs = deedle.ToRecords<DateWrapper>();
return _cache[TZ.GMT] = recs.Select(x => x.DateTime).ToArray();
}
示例3: ShouldReadFromCarbonFrame
public void ShouldReadFromCarbonFrame()
{
// var moniker = "symapp.roll.ctd.us.ty";
// var moniker = "symapp.events.gmtdts.1";
var moniker = "symapp.events.config";
using (var cc = new CarbonClient("PRD", useLocalIdsCache: true))
{
var frame = cc.GetFrameAsync(moniker).Result;
frame.Print();
}
var frame2 = CarbonModel.RetrieveFrameFromCarbon<int>(moniker).Result;
frame2.Print();
}