Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actions triggered by events don't work together #38

Open
potb opened this issue Aug 12, 2023 · 2 comments
Open

Actions triggered by events don't work together #38

potb opened this issue Aug 12, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@potb
Copy link
Member

potb commented Aug 12, 2023

The way we handle events right now makes performing multiple actions at the same time difficult.

For example, when we post a twitter link in an autothread channel, the link won't be replaced by a vxtwitter one.

Maybe we can look into a sequential way of handling our events, using an array of handlers for example.

@neolectron
Copy link
Member

neolectron commented Sep 2, 2023

I think we need some sort of middlewares solution for this.
First thought is https://github.com/fastify/avvio

@potb
Copy link
Member Author

potb commented Sep 4, 2023

For further context, we had a discussion with @neolectron and are considering adopting an approach similar in terms of its implementation.
The intended usage of the modules is illustrated below:

const workflow = [
  voiceOnDemand(), // Configurable standalone module for voice-on-demand.
  patternReplacement() // Configurable standalone module for pattern replacement.
    .after(autoThread((context) => context.newMessage)) // Takes input from previous module; also configurable standalone.
    .after(summarizer((context) => context.autoThreadedChannelId)), // Takes input from previous module; also configurable standalone.
  summarizer(), // Configurable standalone module for summarizing.
  autoThread(), // Configurable standalone module for auto-threading.
];

@neolectron neolectron added the enhancement New feature or request label Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants