I've been toying around with libevent2, and I've got reading files working, but it blocks. Is there any way to make file reading not block just within libevent. Or, do I need to use another IO library for files and make it pump events that I need.
fd = open("/tmp/hello_world",O_RDONLY);
evbuffer_read(buf,fd,4096);
The O_NONBLOCK flag ...
What is the easiest way to disable an entire HTML page until an initial .load call is complete?
What I mean by disable is the user can not interact with it in any way. It is ok for them to navigate away.
I am using jQuery 1.2.6. Is it to set the call to be sync instead of async? how do you set options for this on the .load function?
U...
Ok I have had a problem expressing my problems with the code I am working on without dumping a ton of code; so here is what it would be synchronously (instead of asking it from the view of it being async).
Also for classes when should a variable be accessed through a method argument and when should it be accessed through a instance var...
I am implementing a poller service whose interface looks like this.
poller = Poller.new(SomeClass)
poller.start
poller.stop
The start method is supposed to continuously start hitting an http request and update stuff in the database. Once started, the process is supposed to continue till it is explicitly stoped.
I understand that imp...
I'm using a NetworkStream & TcpClient to asynchronously receive data using BeginRead. I need to apply a time-out to this operation, such that after a specified amount of time the read will be aborted.
As far as I'm able to tell, this isn't supported on NetworkStream or TcpClient - there is a ReceiveTimeout property, but this appears to...
Hi,
I'm using asynchronous methods in my service (Spring 3 @Async annotation). And I've got a problem - spawned thread doesn't have security context. Cause of it is Spring Security by default uses SecurityContextHolder.MODE_THREADLOCAL strategy for its context holder. But I need to use SecurityContextHolder.MODE_INHERITABLETHREADLOCAL s...
So I'm trying to do all my REST calls that download data on the background thread so that the UI stays responsive.
I have a viewcontroller that contains a NSOperationQueue. I create an instance of my importer class that is a subclass of NSOperation. Inside the main() method of my importer, I am setting up a ASIHTTPDataRequest. I create ...
I have a chain of asynchronous events that i want to execute, some of them fetch commands. I understand the basics of using dojo.Deferred, but all of my attempts so far to add a fetch callback have failed...
What im trying to do is 1) add a fetch call to my Deferred object 2) have that fetch function be run, possibly with some extra ar...
Having a lot of problems trying to consume a simple service operator in a WCF Data Service from Silverlight. I've verified the following service operator is working by testing it in the browser:
[WebGet]
public IQueryable<SecurityRole> GetSecurityRolesForUser(string userName) {
string currentUsername = HttpContext.Current.User.Identit...
I would like to have a textbox in a Silverlight app where the user can type in it, and after a few characters are entered the control calls a web service to retrieve a list of potential choices that the user can choose from. Essentially it is a type-ahead combobox but I don't want to keep all of the possible choices in memory I want to ...
I've got a winform, and a bluetooth connection with a lego nxt brick. Now I want to update the form every second to read sensors or the battery level. But if I start a new thread for that, there i a invalid thread operation exception when the thread wants to set the label text.
Can anyone help me?
...
Hi all,
I think that I am having a slow evening but I have a question regarding calling a URL as part of a controller call in a Zend Framework application.
I'm trying integrate an affiliate tracking application into my code, and the only way to register a commission is to call a url and pass the variables as either a POST or GET reques...
Alright, I have ran into a problem when using DownloadDataAsync and having it return the bytes to me. This is the code I am using:
private void button1_Click(object sender, EventArgs e)
{
byte[] bytes;
using (WebClient client = new WebClient())
{
client.DownloadProgressChanged += new DownloadP...
I have a class that has purely static Methods and properties. I am calling an async method on the class "Load" that asks a web service for a chunk of data, which then fires an event that executes the return method, "LoadCompleted". I have no idea how long the call is going to take (the difference between calling the "Load" method, then ...
I am working in Silverlight 4 and implementing a Polling Duplex service with an asynchronous pattern used to update the clients.
// interface for messages back to client
[OperationContract(IsOneWay = true, AsyncPattern=true)]
IAsyncResult BeginSendMessage(byte[] MessageData, AsyncCallback callback, object State);
void ...
I have a chain of async calls, linked together using dojo.Deferred objects as async wrapper (at least how i understand it) and the .then() function to 'link' the async calls.
At any one of the links in the chain, some test could fail (such as my async store fetch returned no objects, etc) and i want to gracefully exit the entire .then(...
Have noticed issue while testing iphone app that if one quickly opens/dismisses a modal view which contains asynchronous http calls the app eventually freezes up with a EXC_BAD_ACCESS message. I'm relatively confident that there aren't any memory leaks in either the modal view or the viewcontroller that's launching it (at least none tha...
Does jQuery.ajax({async: false}) still use the XMLHttpRequest object?
If so, how is the request synchronous?
Is there just some mechanism inside the function definition that allows the asynchronous request put out by the XHR to be wrapped in a synchronous wrapper?
I ask because I want to wrap asynchronous function calls into a synchro...
I'm rebuilding my lazy loader module to accept asyncronus request but i have a BIG problem:
internet explorer don't support script.onload/onerror!!!
The old script did globally eval the target script source read with an ajax sync call,
it works very well,it's cross browser and i can make it async editing 1 variable but it's very tricky ...
This is what I have so far, but it's ugly and feels non-best practicey. For example, if multiple messages are received, it starts the changeTitle cycle multiple times.
var hasFocus = true;
$(window).bind("blur", function() {
hasFocus = false;
});
$(window).bind("focus", function() {
hasFocus = true;
document.title = 'SiteN...