Is the MacBook Pro only four USB type-c interfaces wrong?
The birth of a new technology will always have an impact on existing things or impact, if everyone is afraid of impact and impact, then the world is always like the same now, everyone is good, in their own comfort zone, the society has no innovation and progress.
In fact, the USB TYPE-C interface protocol in three years ago a few technology giant companies involved in the development of the agreement, and promised to promote it in their own products, but who are afraid of a sudden in their own products upgrade USB Type-c interface by consumers scold out Xiang and then affect product sales, at this time, Apple jumped out to do this, in last year's MacBook upgrade has been the USB Type-a canceled, as if everyone is not too much conflict, may be the reason for the use of fewer people, but just released the MacBook Pro canceled all interfaces, only four USB Type-c, and then we all inexplicable climax, said "What Apple retarded!" Do not consider the consumer! Go out to bring a bunch of adapters!! Apple is the money to make accessories!! New phone connection is not new computer!! I'm going to buy the old MacBook Pro!!! Cook is a homosexual!!! Apple eats jujube pill!!! 」。
All right, you won.
If you as a consumer to think carefully, of course, you are a consumer, you can plug and go, how to plug, how to plug in the evening do not have to turn on the lights can plug, speed and fast amazing, this mouth is more useful number of countless, how to use how to use, you will now how to think? Anyway now a lot of Android phones are already USB type-c.
What is Fluentscheduler?
Automated job scheduler with fluent interface.
This is the author's introduction on Github, which is a timed task manager. Like Microsoft's Timer, Quartz.net, Fluentscheduler, and Windows services in. Net, there's almost no difference between the use of quartz.net and the Quartz under Java, and I've written a Spring Using the Quartz Task Scheduler timer is about Quartz.
Timing tasks or job scheduling may also be useful when you specify a time to do statistics, send e-mails, or some business logic that you want to complete, which is what it's all about.
How do I use Fluentscheduler?
I recommend you go to the author's Github to see the source code or example, address: Https://github.com/fluentscheduler/FluentScheduler
Of course, here I use the author's example to do a demonstration and translation, to ensure that anyone can read.
First, install the FluentScheduler
package
Open the package Management Console and enter Install-Package FluentScheduler
. Step: Status bar Selection Tool-Library Package Manager-Package management console , such as:
Input Install-Package FluentScheduler
.
Second, write code
I simply post the author's sample code, it is recommended that you go to Github to see, but I readily translated, it may be easier to read some.
PublicClassDemo:registry{PublicDemo () {Schedule an IJob-to-run at an intervalPerform scheduled tasks once every two seconds immediately. (Specify a time interval to run, depending on your needs, can be seconds, minutes, hours, days, months, years, and so on.) ) schedule<myjob> (). Torunnow (). Andevery (2). Seconds ();Schedule an IJob to run once, delayed by a specific time intervalDelays the execution of a scheduled task at a specified time interval. (Of course, this interval can still be seconds, minutes, hours, days, months, years, etc.) ) schedule<myjob> (). Torunoncein (5). Seconds ();Schedule a simple job-to-run at a specific timePerform scheduled tasks at a specified time (most commonly used. This is performed at 1:10 per day) Schedule (() = Trace.WriteLine ("It ' s 1:10 PM now."). Torunevery (1). Days (). at (13,10); Schedule (() = {Do what you want to do. Trace.WriteLine ("It ' s 1:10 PM now."); }). Torunevery (1). Days (). at (13,10);Schedule a more complex action to run immediately and on an monthly intervalImmediately perform a scheduled task at the month of Monday 3:00 (it can be seen that this is a more complicated point of time, it means it can do it too!) ) schedule<mycomplexjob> (). Torunnow (). Andevery (1). Months (). Onthefirst (Dayofweek.monday). at (3,0);Schedule multiple jobs to being run in a single SchedulePerform two (multiple) tasks in the same plan schedule<myjob> (). Andthen<myotherjob> (). Torunnow (). Andevery (5). Minutes (); }}public class MyJob: ijob{void Ijob.execute () {trace.writeline (" Now the time is: "+datetime.now); }}public class MyOtherJob: ijob{void Ijob.execute () {Trace.WriteLine ( "This is another Job, now the time is:" + DateTime.Now); }}public class MyComplexJob: ijob{void Ijob.execute () {Trace.WriteLine ( "This is a more complex Job, now the time is:" + DateTime.Now); }}
Third, initialize
Global.asax
add a sentence in the
JobManager.Initialize(new Demo());
The above is simple to use, actually enough, of course, there are more perverted needs, the author also wrote in the document, such as this: you want to perform a scheduled task, every Monday 14:00 run. But it's Monday 10:00, so should your program run today or next Monday? It's used here ToRunEvery
.
There is also the processing of concurrent tasks, interested can go to see.
Summarize
Fluentscheduler is a. Net, you can easily implement scheduled tasks of the tool, do not need to write Windows services , more importantly, the time is set up a lot of flexibility, timing task difficult is not so.
Http://www.cnblogs.com/mafly/p/FluentScheduler.html
"Go" ASP. NET MVC uses Fluentscheduler timer to schedule tasks