Skip to main content
September 10, 2013
Answered

Responder in SQLLite

  • September 10, 2013
  • 1 reply
  • 639 views

Hi guys

When using responder eg  new Responder(onSearchResult, searchFailed)  instead of a standard event listener, so you need to remove the Responder in some way once it's complete, as you would an event listener?

If so, how is that done?

Cherers for your help.

This topic has been closed for replies.
Correct answer sinious

I believe a Responder works in more of a singleton means. Just null your reference if it's not scoped. Typically I would scope responder to a class-level object and when I'm cleaning up after my app I simply null the object. You can also sort of anonymously use it in the SQL statements execute as well e.g. mysqlconn.execute(-1, new Responder(someFunction)); 

Just be careful that no more SQL statements execute if you expected a responder to pick up the update or error or you can encounter a runtime error.

1 reply

sinious
siniousCorrect answer
Legend
September 11, 2013

I believe a Responder works in more of a singleton means. Just null your reference if it's not scoped. Typically I would scope responder to a class-level object and when I'm cleaning up after my app I simply null the object. You can also sort of anonymously use it in the SQL statements execute as well e.g. mysqlconn.execute(-1, new Responder(someFunction)); 

Just be careful that no more SQL statements execute if you expected a responder to pick up the update or error or you can encounter a runtime error.

September 23, 2013

Cheers Sinious - makes sense!

sinious
Legend
September 23, 2013

You're welcome