Context-Aware Stream Processing for Distributed IoT Applications