Controlling an Imp with another Imp

I am looking to have two Imp’s ‘communicate’. The simplest representation of my setup would be a switch connected to an input of Imp A and an LED connected to an output of Imp B; the switch on Imp A should be able to turn the LED on Imp B on/off. Any suggestion on how to make this work would be appreciated.

http://devwiki.electricimp.com/doku.php?id=examplecode

I see separate examples of an Imp processing an input event and an Imp controlling an output. My question is about having two Imp’s ‘talking’ to each other via the internet…

imps always communicate via the internet. If you drag a noodle between two imps, it will work for communication wherever the imps are - they do not need to be on the same network.

@Hugo: that’s what I was looking for, thanks!