Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why aren't signals simply called events?

From what I can tell, in Python and and Django, signals are simply delegated events. Is there anything that functionally differentiates them from the typical notion of events in C#, Java, ActionScript, etc?

like image 861
Soviut Avatar asked Nov 27 '22 08:11

Soviut


2 Answers

Actually, "signals" have been around longer than events have. In the earliest usage, a signal was an asynchronous way for processes to get notified that events had occurred. Since Unix is much older than Django (and since a lot of the Django work came from pydispatcher, where the original stuff was done), the name has stuck.

Events are really signals, you might say!

like image 160
John Feminella Avatar answered Nov 29 '22 22:11

John Feminella


Signals typically have an association with an operating system facility and events are typically application-defined. In some technology stacks, the OS-level stuff may be hidden well enough that there isn't a difference in the API, but in others perhaps not.

like image 37
Ben Collins Avatar answered Nov 29 '22 21:11

Ben Collins