tremor-rs / tremor-runtime

Main Tremor Project Rust Codebase
https://www.tremor.rs
Apache License 2.0
858 stars 125 forks source link

a way to determine the input port of an event #933

Open Licenser opened 3 years ago

Licenser commented 3 years ago

Describe the problem you are trying to solve

In tremor script we currently have no way to determine what input port an event came from, this makes it harder to run different logics based on this information.

Describe the solution you'd like

One option would be a tremor::system::port() function (name just a suggestion) that returns the port, an alternative would be extending trickle to run different sets of logic based on the port but with a shared state something like (just a though experiment):

create script badger
with
<config>
script on in
 ... some logic ...
script on snot
  ... some other logic ..
end;

create script badger;

select event from in into badger;
select event from in/snot into badger/snot;
mfelsche commented 3 years ago

This is one part of this RFC: https://github.com/tremor-rs/tremor-rfcs/pull/46