CodingThreading and ASP.NET

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  Ally  
 To:  ALL
35475.1 
I know, I'm non-stop with these recently aren't I...

OK, we have a site where people can upload videos. These then need to be transcoded to the Flash-compatible FLV format. I don't want users to have to wait around while this happens, so I want to start the transcoding on it's own thread, and just beaver away in the background, long after the page has been sent to the user.

Problem is, I can't bloody do it. If I use a BackgroundWorker it doesn't *actually* process in the background- the page still waits for it to complete (it just does some funny stuff like get to PreRender while it waits).

Does anyone know of a foolproof way to launch something in a separate thread? It doesn't need to return any values. My thoughts:

  • Wrap what I'm doing in an .EXE of it's own. Somehow launch this from the CodeBehind in a way that means it doesn't wait for it to complete
  • Make the code a separate page, and then do some kind of Asynchronous WebRequest on that URL from the *other* URL.


...any ideas? Don't say "make a service to do the trancoding"- I'd love to but I don't have access to the Windows machine, just FTP.
0/0
 Reply   Quote More 

 From:  koswix  
 To:  Ally     
35475.2 In reply to 35475.1 
make an EXE that monitors the upload folder and automagically adds any new files in it to a transcoding queueue and spits the results out to the correct place?


Lucky Pierre, a sexual position in which during a three-person sexual encounter with at least two men participating, one male penetrates the anus of the other male, who is simultaneously penetrating either the anus or the vagina of the third person. The man in the middle, who both gives and receives, is the "Lucky Pierre".
0/0
 Reply   Quote More 

 From:  Ally  
 To:  koswix     
35475.3 In reply to 35475.2 
Well that'd be the same as a service in as much as I don't have direct access to the server, so I can't manually make it run an EXE.
0/0
 Reply   Quote More 

 From:  koswix  
 To:  Ally     
35475.4 In reply to 35475.3 

Ah.

 

I have no ideas then :(



Lucky Pierre, a sexual position in which during a three-person sexual encounter with at least two men participating, one male penetrates the anus of the other male, who is simultaneously penetrating either the anus or the vagina of the third person. The man in the middle, who both gives and receives, is the "Lucky Pierre".
0/0
 Reply   Quote More 

 From:  Ally  
 To:  ALL
35475.5 

For anyone who's interested (who knows who might find this on Google), I found that I can compile the code I want to execute into a .EXE file, then start it with a new Process. As long as you don't WaitForExit on that process the page will display, and the EXE will continue to run in the background.

 

Not sure yet if permissions will prove to be an irritating problem, we'll see.

0/0
 Reply   Quote More 

 From:  THERE IS NO GOD BUT (RENDLE)  
 To:  Ally     
35475.6 In reply to 35475.1 
http://msdn.microsoft.com/en-us/library/ms227433.aspx

0/0
 Reply   Quote More 

 From:  Ally  
 To:  THERE IS NO GOD BUT (RENDLE)     
35475.7 In reply to 35475.6 

Aha. I hadn't even considered HTTP handlers. Shudder.

 

(cheers)

0/0
 Reply   Quote More 

Reply to All    
 

1–7

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats