Unit testing async httphandler
If you have a Async HttpHandler as described here, how would one unit test? Would you create instance of the handler class itself or/and the IAsychResult class as well? Any example would be great.. Thx! ...
If you have a Async HttpHandler as described here, how would one unit test? Would you create instance of the handler class itself or/and the IAsychResult class as well? Any example would be great.. Thx! ...
I have a win forms application that contains a Web Browser control. I need to be able to add delay between operations on the web-browser due to the asynchronous nature of navigating. The Document_Complete event is worthless as it does not take into account that a page may contain multiple AJAX requests. The event ofter fires many times...
Hi, I am trying to block the unload event for a page until I get a response from the server for an async json call initiated by the client. To make it clear, the scenario is the following: I need to save the user changes into a database when they close the browser. While doing so, I will show a small div and hide it when we're done ...
Hi I need to send email in asp.net mvc 2 asynchronously after a certain action is executed. i read this thread http://stackoverflow.com/questions/461361/asp-net-mvc-framework-automatically-send-e-mail Any further help is appreciated ...
How can i have any kind of data returned from a method or property within a time frame, and if any data is returned within that time frame an exception is thrown? Pretty much I have a simple method that will perform a simple task, once performed the method returns a value, and if any value is returned within 100 milliseconds I want that...
I am building a javascript widget that should load asynchronously. Problem is that there can be more than 1 of these widgets on the page and that the widget should be initialized by sending it an option array via {}. What is the best way to accomplish this? I heard that simply setting onload or onreadystatechange does not work in all b...
The Silverlight Toolkit contains Unit Testing Functionality that allows to test classes such as the ViewModels in a MVVM application that invoke remote Services asynchronously. I would like to be able to perform my ViewModel Integration Tests against the actual services instead of mocked instances. Is there any support for asynchrono...
This is the function function deleteItem(id) { $.post("_asyncpage.php", {id:id}, function (result) { if (result == true) { $('#'+id).remove(); } }, "json"); } So, to explain, the function receive an id, send to a page that execute random stuff on a db and return true...
I have to execute some code in the context of the main thread. I am using Lazarus + FPC. I receive an event from a thread inside a DLL (shared library if on linux) and my callback function gets called. Note that this function is not a member of any class but a standalone traditional function with a "cdecl" directive attached. I have to ...
I'm curious what delegates methods exists? For instance I'm aware of Asynchronous method calls, like this: class Program { // define a delegate delegate int MyDelegate(String s); static void Main(string[] args) { // create the delegate MyDelegate del = new MyDelegate(myMethod); // invoke the method asynchron...
I have a TCP server that continually monitors for new incoming clients asynchronously and adds them to a client list: public class TcpServer { public List<TcpClient> ClientsList = new List<TcpClient>(); protected TcpListener Server = new TcpListener(IPAddress.Any, 3000); private _isMonitoring = false; public TcpServer()...
I have a request that contains a batch of "tasks" that need to be completed. An "asyncstate" object that gets passed around via both the request/response contains a collection of "PendingTasks" and "CompletedTasks". Once a task has been complete by a request handler, it gets moved into a "CompletedTasks" collection. If the original re...
Setup: Main MDI form with a progress bar and a label. Code in Main form. public delegate void UpdateMainProgressDelegate(string message, bool isProgressBarStopped); private void UpdateMainProgress(string message, bool isProgressBarStopped) { // make sure we are running on the right thread t...
I need to asychronously call a web service from an ASP.NET application. The aspx does not need the answer from the web service. It's just a simple notification. I'm using the ...Async() method from web service stub and <%@Page Async="True" %>. ws.HelloWorldAsync(); My problem: the web page request is waiting for the web service resp...
I have a webservice method getContactsAsync. I've understood that when it's completed it's supposed to raise an event. How can I (still asynchronously) find out when the method is done and use the result? public void GetContacts() { webService.getContactsAsync() } public void GetContactsCompleted(object sender, getContactsAsyncComp...
My development machine is a MacBook (which of course has kqueue). However, in production we're running Linux (which of course uses epoll). Obviously, to know the performance characteristics of my code I need to run it using epoll. That said, is performance that I see under kqueue a decent approximation of what I'll see with epoll? Or...
There are times in my application, when I need to invoke my timer manually. I've tried the following: int originalInterval = t.Interval; t.Interval = 0; t.Interval = originalInterval; but it wasn't consistent. I've created a new timer, inheriting from System.Timers.Timer, and exposed a "Tick" method - but the problem was that the "E...
I'm looking to use an asynchronous web request in silverlight and would like to look at an example which isn't as confusing as the documentation on msdn. ...
We're creating a web service where we're writing files to disk. Sometimes these files will be read at the same time as they are written. If we do this - writing and reading from the same file - we sometimes end up with files that are of the same length, but where some of the data inside are not the same. So with a 350mb file we get mayb...
I am trying to convert some actions within a controller to run asynchronously in an mvc project that is using ninject for dependency injection. I'm following the steps by inheriting AsyncController and changing the methods that correspond to the 'X' action to 'XAsync' and 'XCompleted' but the async action is not getting resolved. I'm con...