Scheduled jobs can be run in 2 modes:
1) You can execute it manually via EPiServer Admin UI. Scheduled job then is ran directly in web application pool process (usually w3wp.exe)
2) Scheduled jobs are ran automatically. This is done via EPiServer Scheduler Windows Service. Service makes sure that appropriate service is ran at particular point in time - e.g. it makes sure that service is triggered at scheduled time (you can set it in job details page in EPiServer Admin UI). When job is triggered automatically via Windows Service - it still runs in web app pool - Windows service remotely invokes web server.
Thanks, that is exactly what I want to know.
I have some questions about schedule job:
Does the schedule job runs in IIS process(web context)? I found that when schedule job "Automatic Emptying of Recycle Bin" runs, OnDeleting event is triggered and event handler in web application can receive this event.
I feel a little bit confused because there is a EPiserver schedule windows service, it looks that the schedule job doesn't run in windows service.
Thanks in advance.