﻿
{"id":10673,"date":"2019-04-08T21:04:46","date_gmt":"2019-04-08T21:04:46","guid":{"rendered":"https:\/\/www.gencayyildiz.com\/blog\/?p=10673"},"modified":"2019-04-08T21:04:46","modified_gmt":"2019-04-08T21:04:46","slug":"asp-net-coreda-hangfire-kutuphanesi-ile-zamanlanmis-gorevler-olusturma","status":"publish","type":"post","link":"https:\/\/www.gencayyildiz.com\/blog\/asp-net-coreda-hangfire-kutuphanesi-ile-zamanlanmis-gorevler-olusturma\/","title":{"rendered":"Asp.NET Core&#8217;da Hangfire K\u00fct\u00fcphanesi \u0130le Zamanlanm\u0131\u015f G\u00f6revler Olu\u015fturma"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<p>Merhaba,<\/p>\n<p>Bu i\u00e7eri\u011fimizde; Asp.NET Core uygulamalar\u0131nda Background Jobs(Arka plan \u0130\u015fleri) ger\u00e7ekle\u015ftirebilmek i\u00e7in bir a\u00e7\u0131k kaynak k\u00fct\u00fcphanesi olan Hangfire&#8217;i inceliyor olaca\u011f\u0131z. Hangfire; \u00e7ok yabanc\u0131 olmad\u0131\u011f\u0131m\u0131z ve zaman\u0131nda hakk\u0131nda detayl\u0131 makale yazd\u0131\u011f\u0131m\u0131z <a href=\"https:\/\/www.gencayyildiz.com\/blog\/c-quartz-net-kutuphanesi-ile-zamanlanmis-gorevler-olusturma\/\" rel=\"noopener noreferrer\" target=\"_blank\">Quartz.Net<\/a> k\u00fct\u00fcphanesinin g\u00fczel bir muadilidir diyebiliriz.<\/p>\n<h4>Background Jobs Nedir?<\/h4>\n<p>Arka plan i\u015fleri olarak nitelendirilen <em>Background Jobs<\/em> asl\u0131nda zamanlanm\u0131\u015f g\u00f6revlerin ta kendisidir. Bazen uygulamalar\u0131m\u0131z\u0131n ana thread d\u0131\u015f\u0131nda bir task i\u015flemesi yahut senaryo gere\u011fi belli aral\u0131klarla belli i\u015flemlerin ger\u00e7ekle\u015ftirilmesi gerekebilmektedir. \u0130\u015fte bu tarz ihtiya\u00e7lara istinaden ger\u00e7ekle\u015ftirilen zamanlanm\u0131\u015f g\u00f6revleri <em>background jobs<\/em> diyerek tarif etmekteyiz.<\/p>\n<h4>Hangfire&#8217;\u0131n Avantajlar\u0131 Nelerdir?<\/h4>\n<ul>\n<li>Olduk\u00e7a kolay kullan\u0131ma ve y\u00f6netilebilirli\u011fe sahiptir.<\/li>\n<li>Hangfire, veritaban\u0131 ile otomatik entegrasyon sa\u011flad\u0131\u011f\u0131 i\u00e7in tan\u0131mlanan i\u015flere ait t\u00fcm kay\u0131tlar\u0131 fiziksel olarak tutmaktad\u0131r. Dolay\u0131s\u0131yla bir i\u015f tam teferruat\u0131yla tamamlanmadan ge\u00e7ilmeyecek, s\u00fcre\u00e7teki olas\u0131 hatalarla kar\u015f\u0131la\u015f\u0131lma durumunda i\u015f tekrardan \u00e7al\u0131\u015ft\u0131r\u0131lacak ve i\u015fe dair son noktay\u0131 koymaks\u0131z\u0131n bu s\u00fcre\u00e7 b\u00f6yle devam edecektir. Dolay\u0131s\u0131yla fiziksel kay\u0131t s\u00f6z konusu oldu\u011fundan dolay\u0131 i\u015f g\u00fcvenli\u011fi hat safhada sunulmaktad\u0131r.<\/li>\n<\/ul>\n<h4>Hangfire Nas\u0131l \u00c7al\u0131\u015f\u0131r? Mimarisi Nas\u0131ld\u0131r?<\/h4>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma.png\" alt=\"Asp.NET Core\u2019da Hangfire K\u00fct\u00fcphanesi \u0130le Zamanlanm\u0131\u015f G\u00f6revler Olu\u015fturma\" width=\"700\" height=\"286\" class=\"aligncenter size-full wp-image-10680\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma.png 700w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-300x123.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/a><br \/>\nHangfire; clienttan al\u0131nan g\u00f6revleri &#8220;Hangfire Job Storage(Hangfire \u0130\u015f Deposu)&#8221; isimli alanda depolayarak s\u0131raya al\u0131r. Server taraf\u0131ndan ilgili depodaki i\u015fler s\u0131ras\u0131yla tek tek al\u0131narak arka planda i\u015flenir ve sonu\u00e7 olarak clienta haber g\u00f6nderir.<\/p>\n<h4>Projeye Hangfire Entegrasyonu<\/h4>\n<p>Asp.NET Core projesine Hangfire&#8217;\u0131 entegre edebilmek i\u00e7in ilgili projenin ana dizinine odaklanm\u0131\u015f powershell ekran\u0131nda a\u015fa\u011f\u0131daki komutu \u00e7al\u0131\u015ft\u0131rman\u0131z yeterli olacakt\u0131r.<br \/>\n<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-1.png\" alt=\"Asp.NET Core\u2019da Hangfire K\u00fct\u00fcphanesi \u0130le Zamanlanm\u0131\u015f G\u00f6revler Olu\u015fturma\" width=\"928\" height=\"100\" class=\"aligncenter size-full wp-image-10685\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-1.png 928w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-1-300x32.png 300w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-1-768x83.png 768w\" sizes=\"auto, (max-width: 928px) 100vw, 928px\" \/><\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\ndotnet add package Hangfire\r\n<\/pre>\n<p>Bu i\u015flemden sonra Hangfire k\u00fct\u00fcphanesi projeye entegre edilmi\u015f olacakt\u0131r.<\/p>\n<h4>Hangfire Kurulumu<\/h4>\n<p>Entegre etti\u011fimiz Hangfire k\u00fct\u00fcphanesini Asp.NET Core projesinde aktif hale getirebilmek i\u00e7in ilk olarak Hangfire&#8217;\u0131n kullanaca\u011f\u0131 veritan\u0131n\u0131 olu\u015fturmam\u0131z gerekmektedir.<br \/>\n<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-2.png\" alt=\"Asp.NET Core\u2019da Hangfire K\u00fct\u00fcphanesi \u0130le Zamanlanm\u0131\u015f G\u00f6revler Olu\u015fturma\" width=\"167\" height=\"182\" class=\"aligncenter size-full wp-image-10688\" \/><\/a><\/p>\n<p>Hangfire; arka planda ger\u00e7ekle\u015fecek olan i\u015fleri s\u0131ral\u0131 bir \u015fekilde kayda almak ve sonu\u00e7lar\u0131n\u0131 takip edebilmek i\u00e7in fiziksel olarak bu veritaban\u0131n\u0131 kullanacakt\u0131r. Uygulama ilk aya\u011fa kalkt\u0131\u011f\u0131nda Hangfire yap\u0131lanmas\u0131 ilgili veritaban\u0131nda kendisine ait tablolar\u0131n var olup olmad\u0131\u011f\u0131n\u0131 check etmekte, e\u011fer yoksa an\u0131nda migrate etmektedir. Evet, zaten birazdan bu durumuda g\u00f6zlemleyece\u011fiz \ud83d\ude42<\/p>\n<p>S\u0131ra veritaban\u0131 provider\u0131n\u0131 &#8220;appsettings.json&#8221; dosyas\u0131na eklemeye geldi.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n{\r\n  &quot;ConnectionString&quot;: &quot;Server=.;Database=HangfireDB;Trusted_Connection=True;&quot;\r\n}\r\n<\/pre>\n<p>Bu i\u015flemden sonra Hangfire k\u00fct\u00fcphanesini servis olarak uygulamaya dahil etmek ve nimetlerinden faydalanabilmek i\u00e7in &#8220;Startup.cs&#8221; dosyas\u0131nda a\u015fa\u011f\u0131daki \u00e7al\u0131\u015fmalar\u0131 ger\u00e7ekle\u015ftirelim.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n    public class Startup\r\n    {\r\n        public IConfiguration Configuration { get; set; }\r\n        public Startup(IConfiguration configuration)\r\n        {\r\n            Configuration = configuration;\r\n        }\r\n        public void ConfigureServices(IServiceCollection services)\r\n        {\r\n            services.AddHangfire(_ =&gt; _.UseSqlServerStorage(Configuration.GetValue&lt;string&gt;(&quot;ConnectionString&quot;)));\r\n            services.AddMvc();\r\n        }\r\n\r\n        public void Configure(IApplicationBuilder app, IHostingEnvironment env)\r\n        {\r\n            if (env.IsDevelopment())\r\n                app.UseDeveloperExceptionPage();\r\n\r\n            app.UseHangfireDashboard();\r\n            app.UseHangfireServer();\r\n\r\n            app.UseMvc(_ =&gt; _.MapRoute(\r\n                name: &quot;Default&quot;,\r\n                template: &quot;{controller=Home}\/{action=Index}\/{id?}&quot;\r\n                ));\r\n        }\r\n    }\r\n<\/pre>\n<p>Yukar\u0131daki kod blo\u011funu incelerseniz e\u011fer;<br \/>\n&#8220;ConfigureServices&#8221; metodunda &#8220;AddHangfire&#8221; fonksiyonu ile Hangfire k\u00fct\u00fcphanesinin kullanaca\u011f\u0131 SQL Server Storage&#8217;ini belirlemekteyiz. &#8220;Configure&#8221; metodunda ise &#8220;UseHangfireDashboard&#8221; ve &#8220;UseHangfireServer&#8221; middlewarelerini devreye sokarak Hangfire k\u00fct\u00fcphanesinin Dashboard \u00f6zelli\u011fiyle birlikte Hangfire Server&#8217;\u0131 uygulamada kullan\u0131labilir hale getiriyoruz.<\/p>\n<p><strong>Hangfire dashboard&#8217;unda neler var?<\/strong> sorunuzu duyar gibiyim&#8230; Bir ka\u00e7 sat\u0131r sonra dashboard yap\u0131s\u0131n\u0131 inceleyece\u011fiz lakin \u015fimdi bu noktaya kadar yapt\u0131\u011f\u0131m\u0131z \u00e7al\u0131\u015fmay\u0131 aya\u011fa kald\u0131rarak Hangfire k\u00fct\u00fcphanesinin tablolar\u0131n\u0131n migrate edildi\u011fini ve temel yap\u0131lanmas\u0131n\u0131n s\u0131k\u0131nt\u0131s\u0131z aktifle\u015ftirildi\u011fini g\u00f6stermek istiyorum.<br \/>\n<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-3.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-3.png\" alt=\"Asp.NET Core\u2019da Hangfire K\u00fct\u00fcphanesi \u0130le Zamanlanm\u0131\u015f G\u00f6revler Olu\u015fturma\" width=\"221\" height=\"449\" class=\"aligncenter size-full wp-image-10695\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-3.png 221w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-3-148x300.png 148w\" sizes=\"auto, (max-width: 221px) 100vw, 221px\" \/><\/a><br \/>\nYukar\u0131daki ekran g\u00f6r\u00fcnt\u00fcs\u00fcnde oldu\u011fu gibi Hangfire yapaca\u011f\u0131 i\u015fleri fiziksel olarak tutaca\u011f\u0131 t\u00fcm veritaban\u0131 yap\u0131lanmas\u0131n\u0131 otomatik migrate etmi\u015f bulunmaktad\u0131r. Burada \u00f6nceki sat\u0131rlarda bahsetti\u011fim durumu tekrarlamak istiyorum ki; ilgili tablolar silindi\u011fi taktirde bir sonraki uygulaman\u0131n aya\u011fa kalkmas\u0131 durumunda, check sonucunda tekrardan migrate edileceklerdir.<\/p>\n<h4>Hangfire Dashboard Yap\u0131s\u0131<\/h4>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-4.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-4.png\" alt=\"Asp.NET Core\u2019da Hangfire K\u00fct\u00fcphanesi \u0130le Zamanlanm\u0131\u015f G\u00f6revler Olu\u015fturma\" width=\"638\" height=\"245\" class=\"aligncenter size-full wp-image-10698\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-4.png 638w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-4-300x115.png 300w\" sizes=\"auto, (max-width: 638px) 100vw, 638px\" \/><\/a><\/p>\n<ul>\n<li><strong>Jobs<\/strong><br \/>\nS\u00fcrece dahil olan t\u00fcm i\u015flemleri durumlar\u0131yla birlikte takip edebildi\u011fimiz sekmedir;<\/p>\n<ul>\n<li><strong><em>Enqueued<\/em><\/strong>, s\u0131radaki i\u015fleri<\/li>\n<li><strong><em>Scheduled<\/em><\/strong>, ileri tarihe ayarlanm\u0131\u015f i\u015fleri<\/li>\n<li><strong><em>Processing<\/em><\/strong>, o anda i\u015flemde olan\/\u00e7al\u0131\u015fan i\u015fleri<\/li>\n<li><strong><em>Succeeded<\/em><\/strong>, ba\u015far\u0131l\u0131 bir \u015fekilde tamamlanm\u0131\u015f i\u015fleri<\/li>\n<li><strong><em>Failed<\/em><\/strong>, ba\u015far\u0131s\u0131z olmu\u015f i\u015fleri<\/li>\n<li><strong><em>Deleted<\/em><\/strong>, silinmi\u015f i\u015fleri<\/li>\n<li><strong><em>Awaiting<\/em><\/strong>, s\u0131ras\u0131n\u0131 bekleyen i\u015fleri<\/li>\n<\/ul>\n<p>g\u00f6sterir.\n<\/li>\n<li><strong>Retries<\/strong><br \/>\nTan\u0131mlanm\u0131\u015f i\u015flerden olas\u0131 hatalar sonucu tekrara d\u00fc\u015fenleri g\u00f6rd\u00fc\u011f\u00fcm\u00fcz sekmedir. Bir i\u015fin ka\u00e7\u0131nc\u0131 kez tekrara girdi\u011fi g\u00f6r\u00fclebilir. Varsay\u0131lan olarak tekrar say\u0131s\u0131 10&#8217;dur.\n<\/li>\n<li><strong>Recurring Jobs<\/strong><br \/>\nTekrarl\u0131 tan\u0131mlanm\u0131\u015f i\u015flerin g\u00f6r\u00fcld\u00fc\u011f\u00fc sekmedir. Her ne kadar ayarlanm\u0131\u015f tekrar s\u00f6z konusu olsada Trigger ile istenildi\u011fi an tetiklenebilir.\n<\/li>\n<li><strong>Servers<\/strong><br \/>\nKullan\u0131lan Hangfire sunucular\u0131n\u0131 g\u00f6rebildi\u011fimiz sekmedir.\n<\/li>\n<\/ul>\n<h4>G\u00f6rev Olu\u015fturma<\/h4>\n<p>Hangfire ile d\u00f6rt farkl\u0131 aksiyonda g\u00f6rev olu\u015fturulabilmektedir. \u015eimdi gelin bu aksiyonlar\u0131 tek tek inceleyelim;<\/p>\n<ul>\n<li><strong>Fire-And-Forget Jobs<\/strong><br \/>\n\u0130\u015f tan\u0131mlan\u0131r ve hemen ard\u0131ndan bir kereye mahsus tetiklenir.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n Hangfire.BackgroundJob.Enqueue(() =&gt; Console.WriteLine(&quot;Fire-And-Forget Jobs tetiklendi&quot;));\r\n<\/pre>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-5.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-5.png\" alt=\"\" width=\"258\" height=\"34\" class=\"aligncenter size-full wp-image-10704\" \/><\/a>\n<\/li>\n<li><strong>Recurring Jobs<\/strong><br \/>\nBelirlenen CRON zamanlamas\u0131na g\u00f6re tekrarlanan i\u015fler tan\u0131mlan\u0131r.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n Hangfire.RecurringJob.AddOrUpdate(() =&gt; Console.WriteLine(&quot;Recurring jobs tetiklendi!&quot;), Hangfire.Cron.MinuteInterval(1));\r\n<\/pre>\n<\/li>\n<li><strong>Delayed Jobs<\/strong><br \/>\nOlu\u015fturulduktan belirli bir zaman sonra sadece bir seferli\u011fine tetiklenecek olan g\u00f6revler tan\u0131mlan\u0131r.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n Hangfire.BackgroundJob.Schedule(() =&gt; Console.WriteLine(&quot;Delayed jobs tetiklendi!&quot;), TimeSpan.FromSeconds(10));\r\n<\/pre>\n<p>\u00d6rne\u011fin, yukar\u0131daki kod blo\u011fundaki g\u00f6rev register edildikten 10 saniye sonra tetiklenecektir.<br \/>\n<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-6.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-6.png\" alt=\"Asp.NET Core\u2019da Hangfire K\u00fct\u00fcphanesi \u0130le Zamanlanm\u0131\u015f G\u00f6revler Olu\u015fturma\" width=\"199\" height=\"30\" class=\"aligncenter size-full wp-image-10706\" \/><\/a>\n<\/li>\n<li><strong>Continuations<\/strong><br \/>\nBirbiriyle ili\u015fkili i\u015flerin oldu\u011fu durumlarda al\u0131nan aksiyondur. Bir jobun tetiklenebilmesi i\u00e7in bir \u00f6ncekinin tamamlanmas\u0131 gerekmektedir.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n var parentJobId = Hangfire.BackgroundJob.Schedule(() =&gt; Console.WriteLine(&quot;1. Job&quot;), TimeSpan.FromSeconds(10));\r\n \/\/Continuations job\r\n Hangfire.BackgroundJob.ContinueWith(parentJobId, () =&gt; Console.WriteLine(&quot;2. Job&quot;));\r\n<\/pre>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-7.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/04\/Asp.NET-Core\u2019da-Hangfire-K\u00fct\u00fcphanesi-\u0130le-Zamanlanm\u0131\u015f-G\u00f6revler-Olu\u015fturma-7.png\" alt=\"Asp.NET Core\u2019da Hangfire K\u00fct\u00fcphanesi \u0130le Zamanlanm\u0131\u015f G\u00f6revler Olu\u015fturma\" width=\"71\" height=\"49\" class=\"aligncenter size-full wp-image-10707\" \/><\/a>\n<\/li>\n<\/ul>\n<p>Evet&#8230; Bu noktadan itibaren Asp.NET Core uygulamalar\u0131nda zamanlanm\u0131\u015f g\u00f6revlerin Hangfire ile tam teferruatl\u0131 nas\u0131l ger\u00e7ekle\u015ftirilebilece\u011fini incelemi\u015f bulunmaktay\u0131z. \u0130lgilenenlerin faydalanmas\u0131 dile\u011fiyle&#8230;<\/p>\n<p>Sonraki yaz\u0131lar\u0131mda g\u00f6r\u00fc\u015fmek \u00fczere&#8230;<br \/>\n\u0130yi \u00e7al\u0131\u015fmalar&#8230;<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Merhaba, Bu i\u00e7eri\u011fimizde; Asp.NET Core uygulamalar\u0131nda Background Jobs(Arka plan \u0130\u015fleri) ger\u00e7ekle\u015ftirebilmek i\u00e7in bir a\u00e7\u0131k kaynak k\u00fct\u00fcphanesi olan Hangfire&#8217;i inceliyor olaca\u011f\u0131z. Hangfire; \u00e7ok yabanc\u0131 olmad\u0131\u011f\u0131m\u0131z ve zaman\u0131nda hakk\u0131nda detayl\u0131 makale yazd\u0131\u011f\u0131m\u0131z Quartz.Net k\u00fct\u00fcphanesinin g\u00fczel bir&#46;&#46;&#46;<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":10680,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2739,2668,2656],"tags":[2804,2803,2805,2809,2808,2807,2806,2810],"class_list":["post-10673","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-net-core","category-asp-net-core-2","category-asp-net-core-2-mvc","tag-arka-plan-isleri","tag-background-job","tag-background-jobs","tag-fire-and-forget-jobs","tag-hangfire","tag-hangfire-is-deposu","tag-hangfire-job-storage","tag-recurring-jobs"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/10673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/comments?post=10673"}],"version-history":[{"count":27,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/10673\/revisions"}],"predecessor-version":[{"id":10708,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/10673\/revisions\/10708"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media\/10680"}],"wp:attachment":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media?parent=10673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/categories?post=10673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/tags?post=10673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}