Event Aggregator.. not getting a response, how to determine completion?

Posted by Duncan_m on Programmers See other posts from Programmers or by Duncan_m
Published on 2012-09-30T06:29:34Z Indexed on 2012/09/30 9:48 UTC
Read the original article Hit count: 178

I'm rewriting a vehicle tracking application, a google maps based thing..

The users are able to search for a vehicle by typing a few characters of the vehicles "callsign".

My application is based around a sort of "event bus" within Backbone.. when a search occurs I send a message on the bus saying something like "does anyone match this?".. If a marker matches the search term it responds with a sort of "yes, I match!"..

My challenge arises when no-one matches, I get no response.. it feels a little hacky to "wait a little while" and check if a response has been recieved..

The application is based around Backbone.js and using the Event Aggregator pattern described in the answer to this question on Stack Overflow: http://stackoverflow.com/questions/7708195/access-function-in-one-view-from-another-in-backbone-js

Is there a well defined design pattern that might assist me here? Sending a request for a response and not getting any responses?

© Programmers or respective owner

Related posts about design

Related posts about design-patterns