Houston, TX
Posts: 23 since Apr 2010
Thanks Given: 17
Thanks Received: 5
|
I will try to answer this. They are alike in that each are blocks of code that are compiled together and share the same rules about variable scope, etc. You can call the method any time you choose, but the event handler is a "call back function" (I believe) and is called by the platform whenever it decides. Call backs also run in the thread of the platform and might(perhaps depending on the language) run async. There are different types of threading setups which I do not understand (Apartment, etc), but have not found it necessary to get my code to run the way I want. Method: Request a strean of live quotes. Call back: Every time there is a quote it (the platform) runs the call back. Perhaps a more experienced programmer can better clarify this. Ken.
|