Skip to content

Commit

Permalink
docs: Update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Mar 17, 2024
1 parent 007a444 commit 8fb3165
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,15 @@ builder.Services.AddCronJob<PrintHelloWorld>(options =>

4. Run your application and see the magic happen

## Triggering a instant job
## Triggering an instant job
If the need arises and you want to trigger a job instantly, you can do so:
```csharp
public class MyService
{
private readonly IInstantJobRegistry jobRegistry;

public MyService(IInstantJobRegistry jobRegistry)
{
this.jobRegistry = jobRegistry;
}

public void MyMethod()
{
jobRegistry.AddInstantJob<MyJob>("I am an optional parameter");
}
public MyService(IInstantJobRegistry jobRegistry) => this.jobRegistry = jobRegistry;

public void MyMethod() => jobRegistry.AddInstantJob<MyJob>("I am an optional parameter");
}
```

0 comments on commit 8fb3165

Please sign in to comment.