Comments (1)
I am going to briefly go over my idea and plan for the participant code.
I am thinking of having 3 main tasks as part of a task pool managed by participant.cpp
. This participant.cpp
is ran by a participant_main.cpp
, whose job it is to just run that single instance of Participant
. The three tasks that the participant makes, and manages, are as follows:
ConsoleTask
. This task's job is to take whatever input, depending upon the indication presented by the interface using it, and display it. The idea is that it will erase a line, replacing it with a message (in the case of a multicast receive), or print a new prompt. In just typing this out, I am realizing there is probably a better way, but I am floating this out there for now.MessengerTask
. This task's job is to manage the socket on its own thread and send received messages to theConsoleTask
for it to format accordingly. Since this task handles the socket connection, it will also send messages that can be received in an internal outgoing message queue.InputTask
. This task's job is to listen to the user's input and interject the necessary results intoConsoleTask
and/orMessageTask
. This "task" doesn't have to be a task. It could be done in the main thread.
A few quick notes on my own ideas though. First, all of the necessary processes could probably be handled in just 2 threads without being that complicated. Second, I am not sure if implementing the participant this way is abusing the thread_pool system, rather than utilizing it.
In any event, those are my thoughts as of yet. I have already developed a method to "replace" a prompt in console and re-print the prompt to accept user input.
from csci6780.
Related Issues (16)
- Create `InputParser` for participant
- Test `InputParser`
- Implement CI with Github Actions
- Create `Registrar` class for Coordinator
- Create the `Messenger` class for Coordinator
- Create the `Coordinator` class.
- Create a thread-safe queue.
- Add tests for `MessageLog` class.
- Add tests for `ConnectedParticipants` class.
- Add tests for `Messenger` class.
- Add tests for the `MessengerManager` class.
- Add tests for the `Registrar` class.
- Write Protobufs HOT 1
- Create socket communication library
- Determine high-level architecture for nodes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csci6780.