davidmoten / davidmoten/state-machine

How to push a stream of JSON messages through state-machine?

Open
#1 16 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Java
Stars
145
Forks
14
PR merge metrics
No merged PRs in 30d

Description

From email:

David-
Thank you so much for contributing to the code for RxJava2.

I have an application where I am receiving a single Flowable stream of JSON-formatted events that come from a number of different sources. Each event has the sourceID in it. These events are asynchronous. There can be a few events for a given source or a continual (never-ending) stream of events. I cannot know the specific sourceID beforehand, and there could be events from a thousand different sources intermingled in the single stream.

Question: If I need to evaluate the state of a given source using a Finite State Machine, do you have any ideas about adapting your state-machine to safely be used in such an environment? I could see trying to keep the state of a given source in a hashmap, but cannot quite envision how to fold that into your state machine into that scheme. Do any other approaches come to mind?

Kindest regards,

Ewin Barnett
Columbia, Missouri.

Contributor guide

No contributing guide indexed for this repository

Research direction

This is a usage question about adapting the Java state machine to interleaved JSON Flowable events and maintaining state per unknown source ID. Read the issue discussion and the project's public API or documentation first; done would be a maintainer-approved explanation or documented approach, but no target file or test is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.