当前位置: 首页>>代码示例>>C#>>正文


C# JobHost.Call方法代码示例

本文整理汇总了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);
        }
开发者ID:amazedsaint,项目名称:RssReaderAzureJobs,代码行数:10,代码来源:Program.cs

示例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);
        }
开发者ID:JulianoBrugnago,项目名称:azure-webjobs-sdk-extensions,代码行数:15,代码来源:CoreBindingEndToEndTests.cs

示例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;
        }
开发者ID:transformersprimeabcxyz,项目名称:ResourceFirstTranslations,代码行数:23,代码来源:Program.cs

示例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);
        }
开发者ID:oaastest,项目名称:azure-webjobs-sdk-extensions,代码行数:20,代码来源:FileBindingEndToEndTests.cs

示例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"));
        }
开发者ID:chungvinhkhang,项目名称:azure-webjobs-sdk,代码行数:14,代码来源:BlobOverheadPerfTest.cs

示例6: Main

 static void Main(string[] args)
 {
     JobHost host = new JobHost();
     var methodInfo = typeof(Program).GetMethod("CheckSitesFunction");
     host.Call(methodInfo);
 }
开发者ID:DustinH,项目名称:SiteMonitR,代码行数:6,代码来源:Program.cs

示例7: Main

        static void Main()
        {
            CreateDemoData();

            JobHost host = new JobHost();
            host.Call(typeof(Program).GetMethod("ManualTrigger"));

            host.RunAndBlock();
        }
开发者ID:andreychizhov,项目名称:microsoft-aspnet-samples,代码行数:9,代码来源:Program.cs

示例8: PrepareHostForTrigger

        private void PrepareHostForTrigger(JobHost host, bool startHost)
        {
            host.Call(typeof(AsyncCancellationEndToEndTests).GetMethod("WriteQueueMessage"));

            if (startHost)
            {
                host.Start();
                Assert.True(_functionStarted.WaitOne(DefaultTimeout));
            }
        }
开发者ID:ConnorMcMahon,项目名称:azure-webjobs-sdk,代码行数:10,代码来源:AsyncCancellationEndToEndTests.cs

示例9: Main

        public static void Main()
        {
            JobHost jobHost = new JobHost();

            jobHost.Call(typeof(Cleanup).GetMethod("CleanupFunction"));
        }
开发者ID:andreychizhov,项目名称:microsoft-aspnet-samples,代码行数:6,代码来源:Program.cs

示例10: Main

 static void Main(string[] args)
 {
     JobHost host = new JobHost();
     host.Call(typeof(Program).GetMethod("WriteFile"));
     //host.RunAndBlock();
 }
开发者ID:ledgarl,项目名称:Samples,代码行数:6,代码来源:Program.cs


注:本文中的JobHost.Call方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。