ServiceStack 서비스에서 Hangfire 백그라운드 작업을 시작하는 방법이 있습니까? ServiceStack 서비스를 해결할 수있는 MVC 내에서 이미 작업을 시작할 수 있었지만 ServiceStack에서이 작업을 수행 할 수 있기를 원했습니다.ServiceStack에서 Hangfire 사용
2
A
답변
3
좀 더 조사한 후에 나는이 게시물 setup example without owin?을 발견했습니다.
한 가지 해결 방법은 전체 Hangfire nuget 패키지를 설치하지 말고 Owin 패키지 참조 만 필요로하는 Hangfire.Core 및 Hangfire.SqlServer (또는 해당 저장소 옵션) 만 설치하는 것입니다. 유일한 단점은 당신이 Hangfire 대시 보드를 사용할 수 없다는 것입니다. 그런 다음
Hangfire 다음과 같은 코드를 통해 모든 작업을 시작 :
또한 당신이 HangFire JobActivator의 ServiceStack Funq를 사용할 수에서JobStorage.Current = new SqlServerStorage("connection string");
var server = new BackgroundJobServer();
server.Start();
RecurringJob.AddOrUpdate(() => System.Diagnostics.Debug.WriteLine("No OWIN"), Cron.Minutely);
:
JobActivator.Current = new FunqJobActivator(container);
다음과 같이 FunqJobActivator을 만든 후 :
를public override object ActivateJob(Type jobType)
{
var resolved = _container.TryResolve(jobType);
if (resolved == null)
{
foreach (Type it in jobType.GetInterfaces())
{
resolved = _container.TryResolve(it);
if(resolved != null)break;
}
}
return resolved;
}
+0
RegisterAutoWiredAs
관련 문제
- 1. 대시 보드없이 HangFire 사용
- 2. ServiceStack에서 ASP.NET 멤버십 사용
- 3. 고유 ID가있는 hangfire 일정 사용
- 4. hangfire 서버를 인스턴스화하지 않고 hangfire 작업을 제거합니다.
- 5. Hangfire + ASP.NET MVC
- 6. ServiceStack에서 RedisClient의 Eval/Lua 연산 사용?
- 7. InRequestScope를 사용하여 Ninject가있는 Hangfire
- 8. UF 시간의 Hangfire CRON
- 9. Hangfire ASP.NET 코어 MVC
- 10. Hangfire 설치/시작
- 11. 여러 서버가있는 Hangfire
- 12. Hangfire DbContext가 작동하지 않습니다.
- 13. Hangfire 작업에서 Url.Action이 있습니다.
- 14. ServiceStack에서 OnDelete에 값을받지 않음
- 15. ServiceStack에서 개체 목록 전달
- 16. ServiceStack에서 CustomUserSession serialize
- 17. ServiceStack에서 DTO의 값 구조체
- 18. ServiceStack에서 리디렉션 수행
- 19. ServiceStack에서 Github과 유사한 경로
- 20. ServiceStack에서 플러그인 테스트하기
- 21. ServiceStack에서 웹 소켓을 지원합니까?
- 22. ServiceStack에서 빈 XML을 반환합니다.
- 23. Hangfire - 작업에서 서버에 액세스 하시겠습니까?
- 24. 코드에서 Hangfire 작업 ID를 사용하십시오.
- 25. Hangfire Job에서 UserManager 가져 오기
- 26. Hangfire 구성 - 데이터베이스를 핑하는 빈도
- 27. Hangfire - 지정된 큐 이름을 사용하는 되풀이 작업
- 28. ServiceStack에서 특정 사용자의 세션을 제거하려면 어떻게해야합니까?
- 29. servicestack에서 특정 범위의 httphandler를 구현합니다.
- 30. ServiceStack에서 다른 사용자의 세션을 업데이트하십시오.
또한 [Hangfire 지원 포럼] (htt)에 게시하는 데 도움이 될 수 있습니다. ps : //discuss.hangfire.io/). – mythz