本文整理汇总了C#中JobHost.Call方法的典型用法代码示例。如果您正苦于以下问题:C# JobHost.Call方法的具体用法?C# JobHost.Call怎么用?C# JobHost.Call使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JobHost
的用法示例。
在下文中一共展示了JobHost.Call方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main()
{
// See the AzureJobsData and AzureJobsRuntime in the app.config
var host = new JobHost();
var m = typeof(Program).GetMethod("AggregateRss");
host.Call(m);
Console.WriteLine(" aggregated to:");
Console.WriteLine("https://{0}.blob.core.windows.net/blog/output.rss.xml", host.UserAccountName);
}
示例2: CanBindExecutionContext
public void CanBindExecutionContext()
{
JobHostConfiguration config = new JobHostConfiguration
{
TypeLocator = new ExplicitTypeLocator(typeof(CoreTestJobs))
};
config.UseCore();
JobHost host = new JobHost(config);
host.Call(typeof(CoreTestJobs).GetMethod("ExecutionContext"));
ExecutionContext result = CoreTestJobs.Context;
Assert.NotNull(result);
Assert.NotEqual(Guid.Empty, result.InvocationId);
}
示例3: Main
static int Main(string[] args)
{
var options = new Options();
if (CommandLine.Parser.Default.ParseArguments(args, options))
{
if (0 == String.Compare(options.JobType, "azure", StringComparison.CurrentCultureIgnoreCase))
{
Debug.WriteLine("Running in Azure WebJob mode");
var host = new JobHost();
host.Call(typeof(Program).GetMethod("SyncBranchResourceFiles"));
}
else
{
Debug.WriteLine("Running in local mode");
SyncBranchResourceFiles();
}
return 0;
}
return 2;
}
示例4: VerifyInputBinding
private async Task VerifyInputBinding(JobHost host, MethodInfo method)
{
string data = Guid.NewGuid().ToString();
string inputFile = Path.Combine(rootPath, ImportTestPath, string.Format("{0}.txt", method.Name));
File.WriteAllText(inputFile, data);
host.Call(method);
string outputFile = Path.Combine(rootPath, OutputTestPath, string.Format("{0}.txt", method.Name));
await TestHelpers.Await(() =>
{
return File.Exists(outputFile);
});
// give time for file to close
await Task.Delay(1000);
string result = File.ReadAllText(outputFile);
Assert.Equal(data, result);
}
示例5: RunWebJobsSDKTestInternal
private static void RunWebJobsSDKTestInternal(bool disableLogging)
{
JobHostConfiguration hostConfig = new JobHostConfiguration(_connectionString);
hostConfig.NameResolver = _nameResolver;
hostConfig.TypeLocator = new FakeTypeLocator(typeof(BlobOverheadPerfTest));
if (disableLogging)
{
hostConfig.DashboardConnectionString = null;
}
JobHost host = new JobHost(hostConfig);
host.Call(typeof(BlobOverheadPerfTest).GetMethod("BlobToBlob"));
}
示例6: Main
static void Main(string[] args)
{
JobHost host = new JobHost();
var methodInfo = typeof(Program).GetMethod("CheckSitesFunction");
host.Call(methodInfo);
}
示例7: Main
static void Main()
{
CreateDemoData();
JobHost host = new JobHost();
host.Call(typeof(Program).GetMethod("ManualTrigger"));
host.RunAndBlock();
}
示例8: PrepareHostForTrigger
private void PrepareHostForTrigger(JobHost host, bool startHost)
{
host.Call(typeof(AsyncCancellationEndToEndTests).GetMethod("WriteQueueMessage"));
if (startHost)
{
host.Start();
Assert.True(_functionStarted.WaitOne(DefaultTimeout));
}
}
示例9: Main
public static void Main()
{
JobHost jobHost = new JobHost();
jobHost.Call(typeof(Cleanup).GetMethod("CleanupFunction"));
}
示例10: Main
static void Main(string[] args)
{
JobHost host = new JobHost();
host.Call(typeof(Program).GetMethod("WriteFile"));
//host.RunAndBlock();
}