473,378 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

what is an asynchronous event?

Hi All,

When we say events are processed asynchronously in for instance Sharepoint
,what dose it mean?

Thanks for your help.
Ali

Nov 16 '05 #1
13 4362
I somehow know what synch and asynch are.here might not be a good place to
ask this question and maybe I have to post it to sharepoint newsgroup but
**symantically** I have problem underestanding this parageraph:
"Events are processed asynchronously. As a result, a registered event
handler will only be notified about the document deletion after that
document has already been deleted from the SQL ServerT backend database."

Thanks

"John Timney (ASP.NET MVP)" <ti*****@despammed.com> wrote in message
news:uI****************@TK2MSFTNGP10.phx.gbl...
Synchronous means that two things happen with some type of
synchronization -- I.e. there's a well-defined relationship between the
times at which the two happen. Ie a radio'conversation - speak your words
and say over, then the next person speaks and says over.

Therefore Asynchronous means the opposite in that there's not really a
well-defined relationship between the times at which two things happen.
Like a telephone conversation - one person doesn't have to finish speaking
before the other speaks.
--
Regards
John Timney
ASP.NET MVP
Microsoft Regional Director

"ALI-R" <ne****@microsoft.com> wrote in message
news:ul**************@TK2MSFTNGP12.phx.gbl...
Hi All,

When we say events are processed asynchronously in for instance Sharepoint ,what dose it mean?

Thanks for your help.
Ali


Nov 16 '05 #2
I read this as saying that there is no synchronous way to delete a
document from SharePoint. You have no choice but to supply an event
handler that will be called after the document has been deleted. If you
want synchronous behaviour (delete-and-wait-for-completion) then you
have to code it yourself.

That's what I get out of it, anyway.

Nov 16 '05 #3
Sorry for posting with a messed up date - I have corrected this.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"John Timney (ASP.NET MVP)" <ti*****@despammed.com> wrote in message
news:uI****************@TK2MSFTNGP10.phx.gbl...
Synchronous means that two things happen with some type of
synchronization -- I.e. there's a well-defined relationship between the
times at which the two happen. Ie a radio'conversation - speak your words
and say over, then the next person speaks and says over.

Therefore Asynchronous means the opposite in that there's not really a
well-defined relationship between the times at which two things happen.
Like a telephone conversation - one person doesn't have to finish speaking
before the other speaks.
--
Regards
John Timney
ASP.NET MVP
Microsoft Regional Director

"ALI-R" <ne****@microsoft.com> wrote in message
news:ul**************@TK2MSFTNGP12.phx.gbl...
Hi All,

When we say events are processed asynchronously in for instance Sharepoint ,what dose it mean?

Thanks for your help.
Ali


Nov 16 '05 #4
I'm guessing that the code in question is something like this
psuedo-code.

Fire Event "About to Delete File"
Delete file
Fire Event "File Deleted"

However, since the "Fire Event" method will only place the event in the
message queue, nothing will recieve either event until after the file has
been deleted. If the events were synchronous, then Fire Event would not
return until all listeners had received the event.
"ALI-R" <ne****@microsoft.com> wrote in message
news:uU**************@TK2MSFTNGP12.phx.gbl...
I somehow know what synch and asynch are.here might not be a good place to
ask this question and maybe I have to post it to sharepoint newsgroup but
**symantically** I have problem underestanding this parageraph:
"Events are processed asynchronously. As a result, a registered event
handler will only be notified about the document deletion after that
document has already been deleted from the SQL ServerT backend database."

Nov 16 '05 #5
So what I have underestood of what told me is that the process is like this
in **Asynchronous** approach:

1) User requests to delete the File
2) The file is deleted
3) Event handler gets notified about Deletion

So ,if we pretend that Events are process **Synchronously** the sequence
would be like this:

1) User requests to delete the File
2) Event handler gets notified about Deletion
3) The file is deleted.

Correct me if I'm wrong!!!thanks for yur help

Thasnks
Ali
"ALI-R" <ne****@microsoft.com> wrote in message
news:ul**************@TK2MSFTNGP12.phx.gbl...
Hi All,

When we say events are processed asynchronously in for instance Sharepoint
,what dose it mean?

Thanks for your help.
Ali

Nov 16 '05 #6
So what I have underestood of what told me is that the process is like this
in **Asynchronous** approach:

1) User requests to delete the File
2) The file is deleted
3) Event handler gets notified about Deletion

So ,if we pretend that Events are process **Synchronously** the sequence
would be like this:

1) User requests to delete the File
2) Event handler gets notified about Deletion
3) The file is deleted.

Correct me if I'm wrong please!!!thanks for your help

Thasnks
Ali

"James Curran" <ja*********@mvps.org> wrote in message
news:Oi**************@TK2MSFTNGP11.phx.gbl...
I'm guessing that the code in question is something like this
psuedo-code.

Fire Event "About to Delete File"
Delete file
Fire Event "File Deleted"

However, since the "Fire Event" method will only place the event in the
message queue, nothing will recieve either event until after the file has
been deleted. If the events were synchronous, then Fire Event would not
return until all listeners had received the event.
"ALI-R" <ne****@microsoft.com> wrote in message
news:uU**************@TK2MSFTNGP12.phx.gbl...
I somehow know what synch and asynch are.here might not be a good place to ask this question and maybe I have to post it to sharepoint newsgroup but **symantically** I have problem underestanding this parageraph:
"Events are processed asynchronously. As a result, a registered event
handler will only be notified about the document deletion after that
document has already been deleted from the SQL ServerT backend
database."

Nov 16 '05 #7
No, a synchronous invocation would look like this:

1) User requests to delete a file. User is left waiting.
2) File is deleted
3) Control is finally returned to user after file is deleted.

You have the idea of asynchrony correct:

1) User requests to delete a file; control is immediately returned to
user
2) File is deleted
3) User is notified that file is deleted.

Of course, in both of these scenarios, "user" can be seen as the real
user (synchrony is bad form in this case, leaving the user with an
unresponsive application while the file deletion is taking place), or
"user" can be seen as the program calling the deletion routine.

Nov 16 '05 #8
In synchronous invocation ,what is the role of event handler? where is the
event handler in this approach? you only talked about the use,my interest is
to know how event handler gets notified in synchronous invocation .
1) User requests to delete a file. User is left waiting.
2) File is deleted
3) Control is finally returned to user after file is deleted.
Thanks Bruce,
ALi-R

"Bruce Wood" <br*******@canada.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com... No, a synchronous invocation would look like this:

1) User requests to delete a file. User is left waiting.
2) File is deleted
3) Control is finally returned to user after file is deleted.

You have the idea of asynchrony correct:

1) User requests to delete a file; control is immediately returned to
user
2) File is deleted
3) User is notified that file is deleted.

Of course, in both of these scenarios, "user" can be seen as the real
user (synchrony is bad form in this case, leaving the user with an
unresponsive application while the file deletion is taking place), or
"user" can be seen as the program calling the deletion routine.

Nov 16 '05 #9
I don't know about the particular routines you're calling, but usually
a synchronous invocation does not involve event handlers at all: you
call a method, it waits until some operation completes, then it returns
to you.

Of course, there may be an asynchronous invocation going on under the
covers. Some "synchronous" method invocations are nothing more than
methods that send an event and don't return until the corresponding
reply event comes back. However, from the point of view of the caller,
a synchronous invocation doesn't need an event handler because you know
when the operation is done: when the method returns.

Nov 16 '05 #10
Thanks Bruce,Like always your answers are informative.

Ali-R
"Bruce Wood" <br*******@canada.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
I don't know about the particular routines you're calling, but usually
a synchronous invocation does not involve event handlers at all: you
call a method, it waits until some operation completes, then it returns
to you.

Of course, there may be an asynchronous invocation going on under the
covers. Some "synchronous" method invocations are nothing more than
methods that send an event and don't return until the corresponding
reply event comes back. However, from the point of view of the caller,
a synchronous invocation doesn't need an event handler because you know
when the operation is done: when the method returns.

Nov 16 '05 #11
Thanks. :)

One more thing: I just remembered an example of a synchronous operation
that accepts a delegate, which is easily confused with an event handler
(since handling events is a common use for a delegate).

If you look at Image.GetThumbnailImage(), you'll see that it accepts a
"callback delegate", even though it is a synchronous operation (that
is, it doesn't return to its caller until the thumbnail image is
complete).

Don't confuse this with an "event handler". GetThumbnailImage() calls
this delegate from time to time to see if the user wants to cancel the
operation. However, it's just a delegate. There are no events involved.
Same language construct, different purpose.

Nov 16 '05 #12
Bruse a quick question:

For innstance calling Update method from DataAdapter (According to your
explanation) must be classified as Synchronous invocation,right?
because the user is left waiting till he gets notified by the result of his
invoction.

Thanks
Ali-R
"Bruce Wood" <br*******@canada.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Thanks. :)

One more thing: I just remembered an example of a synchronous operation
that accepts a delegate, which is easily confused with an event handler
(since handling events is a common use for a delegate).

If you look at Image.GetThumbnailImage(), you'll see that it accepts a
"callback delegate", even though it is a synchronous operation (that
is, it doesn't return to its caller until the thumbnail image is
complete).

Don't confuse this with an "event handler". GetThumbnailImage() calls
this delegate from time to time to see if the user wants to cancel the
operation. However, it's just a delegate. There are no events involved.
Same language construct, different purpose.

Nov 16 '05 #13
Yes. I've used it myself, and it's synchronous: the caller is left
waiting until the database is updated and the number of affected rows
is returned.

I haven't tried this myself, but if you wanted an asynchronous Update
(update the database while "I" (the calling method) continue to do
something else, and let me know when you're done), it looks to me as
though you have to "roll your own" asynchrony by spinning off another
thread and asking for notification when that other thread finishes its
work (the Update). That way you could continue what you were doing
while the other thread blocked on the Update operation. When the
Updated completed, the other thread would then send you an event (via
Invoke) to tell you that it was done, and terminate.

Your thread (the main thread) could then continue working while the
Update was happening, and either pay little attention to the resulting
event coming back, or, if the user asked to do something that logically
required the update to be complete, block at that point, waiting for
the Update to finish before moving on. (Asynchrony doesn't mean that
you can't _ever_ wait for the operation to complete before moving on;
it just means that you have the choice not to wait if you don't want
to. In a synchronous world, you have no choice: you have to wait.)

You might want to read at least part of Jon Skeet's article on threads:
http://www.yoda.arachsys.com/csharp/threads/

Nov 16 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: David | last post by:
Hi There! I'm using Timer control to record how long my application perform certain tasks. However, apparently Timer control is not doing its' job (i.e. Not firing Tick event) while my...
3
by: Matthew King | last post by:
Hi all I've written a asynchronous socket client class, but i've found that in order to consume it I have to use events, and cannot simply for example SocketClient client = new...
8
by: Trotsky | last post by:
Hi I have asked a similar question on the web services discussion group, but the question is a bit more related to ASP.Net. Basically I have a ASP.Net application that calls a web service...
1
by: Henrik Dahl | last post by:
Issue: I have a remote service executing notoriously asynchronously which I must be able to use from my Compute_Click(...) event handler. The WebForm I have contains only two controls: A Compute...
1
by: dba123 | last post by:
I need to perform Asynchronous Inserts using DAAB. So far I have a method which does an insert but how can I do this Asyncronously so that it does not affect the load on our public production...
3
by: =?Utf-8?B?aGVyYmVydA==?= | last post by:
I need to build an event-based asynchronous pattern (around a send/receive messaging API). Is there a step-by-step guidance about how to write code for the EBAP ? Does any book cover this theme...
4
by: Morgan Cheng | last post by:
Since ASP.NET 2.0, asynchronous web service client can be implemented with event-based pattern, instead of original BeginXXX/EndXXX pattern. However, I didn't find any material about event-based...
0
by: Morgan Cheng | last post by:
Since ASP.NET 2.0, asynchronous web service client can be implemented with event-based pattern, instead of original BeginXXX/EndXXX pattern. However, I didn't find any material about event-based...
167
by: darren | last post by:
Hi I have to write a multi-threaded program. I decided to take an OO approach to it. I had the idea to wrap up all of the thread functions in a mix-in class called Threadable. Then when an...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.