اجرای منظم یک API در فواضل زمانی قابل تنظیم
Calling a web api in certain time slice
What is this!
This is a tiny Windows Service to Call a Web API in a specific time slice.
How to Configure
-
Open
MalekMakan.ApiCallerService.exe.config
file -
There are three keys in
appSettings
section (node)- Interval: in milliseconds. This is what telling the how frequent call the service. By default, it is 1 min (6000 ms).
- BaseAddress: Define base url or api here.
- Example: http://jsonplaceholder.typicode.com/
- Rout: this rout will be added to base address and they both show the api URL together.
- Example: posts
- Please keep in mind that the calling api must be GET type!
- You May include your parameter(s) in the Rout.
-
Save and Close.
How to Install
-
Run Command Prompt as Administrator.
-
Change directory to %SystemDrive%\Windows\Microsoft.NET\Framework\v4.0.30319
-
Run installutil.exe to install the service:
installutil.exe ExtractionPath\MalekMakan.ApiCallerService.exe
something like this: c:\Windows\Microsoft.NET\Framework\v4.0.30319>installutil.exe c:\MACService\MalekMakan.ApiCallerService.exe
-
Punch down this command and try to Start Service:
net start MalekMakanApiCallerService
Like this: c:\Windows\Microsoft.NET\Framework\v4.0.30319>net start MalekMakanApiCallerService
What else
- Enjoy that.
- Send any feedback via mohammad@malekmakan.com, or visit me at my personal website.
- Check my tech. updates on CodeGeek.ir.
Cheers
Download
نویسنده : محمد ملک مکان
یکشنبه 3 مرداد 1395
یکشنبه 3 مرداد 1395
ایده ها، نظرات و سوالات دوستان ما