facebook / wangle

Wangle is a framework providing a set of common client/server abstractions for building services in a consistent, modular, and composable way.
Apache License 2.0
3.04k stars 535 forks source link

Sharing common state between filters #149

Open conqerAtapple opened 5 years ago

conqerAtapple commented 5 years ago

Hello Wanglers If I had to share some common state between filters in the Pipeline what is the recommended way to do this? Say, the first filter unwraps a network packet which contains header with information about the entire connection duration that can be shared between different filters, how do I extract this information/header in one filter and populate a map or something that can be used by other filters.

thanks

graphcareful commented 4 years ago

Yes I would like to know the same thing. In more then one place in the documentation the following is stated:

When events are called, a Context* object is passed to the Handler - this means state can be stored in the context object, and a single instantiation of any individual Handler can be used for the entire program.

, however a concrete example is never shown.