Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Parser idea #30

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Parser idea #30

wants to merge 11 commits into from

Conversation

Gelbpunkt
Copy link
Collaborator

@Gelbpunkt Gelbpunkt commented Oct 31, 2019

This is a first take at a parser for a human-readable protocol. Targets #15

It's WIP and I'll start separating it onto multiple files when the syntax itself gets accepted.

There's 5 actions: CONNECT, PING, INFO, REQUEST, RESPOND
All can be called simply with ACTION;, except REQUEST and RESPOND.
Those require arguments, e.g. REQUEST 'json goes here';.
Optionally, they take a FROM/TO argument that is either ALL or an integer of e.g. the receiver.
CONN, REQ and RESP are aliases.

Examples:

CONNECT;
REQUEST 'whatever';  # Equals REQUEST 'whatever' FROM ALL;
REQUEST "whatever" FROM 2;  # Double quotes work, too
RESP "hello" TO 3;  # Respond to a specific sender

I made a simple interactive example. You can run it like this:

python3 yarpc/parser.py

Then type your queries and it'll output the actual query string or syntax errors.

Note: Syntax is subject to change, I might go for REQUEST 'handler_func' WITH 'parameter1', 'parameter2', 3 FROM ALL;. But that would remove the JSON-ish syntax

@codecov
Copy link

codecov bot commented Oct 31, 2019

Codecov Report

Merging #30 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master     #30   +/-   ##
======================================
  Coverage    53.9%   53.9%           
======================================
  Files          14      14           
  Lines         371     371           
======================================
  Hits          200     200           
  Misses        171     171
Impacted Files Coverage Δ
jarpc/types.py
jarpc/typing.py 100% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6de165e...310352a. Read the comment docs.

@Gelbpunkt
Copy link
Collaborator Author

That's the next step when parser is done

@Fogapod Fogapod added the enhancement New feature or request label Nov 3, 2019
@Fogapod
Copy link
Member

Fogapod commented Nov 3, 2019

Not sure how this should work under the hood. Are you only going to work on parser or you can suggest changes to library internals as well?

yarpc/parser.py Outdated Show resolved Hide resolved
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants