In programming, particularly in event-driven architectures, what is the role of a "listener" in relation to an "invoker"?
A) A listener processes data and directly executes code, while an invoker waits for input.
B) A listener waits for specific events or conditions to occur, while an invoker triggers or dispatches these events to the listener.
C) A listener handles errors and exceptions, while an invoker manages user authentication.
D) A listener stores data, while an invoker retrieves data from a database.