{"id":16753410,"url":"https://github.com/thbar/petite-lettre","last_synced_at":"2025-04-10T16:06:36.276Z","repository":{"id":56887873,"uuid":"141002","full_name":"thbar/petite-lettre","owner":"thbar","description":"YAML-based inter-process communication.","archived":false,"fork":false,"pushed_at":"2010-09-07T08:19:51.000Z","size":88,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T19:32:04.502Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thbar.png","metadata":{"files":{"readme":"README.textile","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-03-02T10:08:58.000Z","updated_at":"2023-07-01T21:26:57.000Z","dependencies_parsed_at":"2022-08-20T15:20:51.918Z","dependency_job_id":null,"html_url":"https://github.com/thbar/petite-lettre","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thbar%2Fpetite-lettre","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thbar%2Fpetite-lettre/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thbar%2Fpetite-lettre/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thbar%2Fpetite-lettre/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thbar","download_url":"https://codeload.github.com/thbar/petite-lettre/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248250743,"owners_count":21072682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T02:50:00.696Z","updated_at":"2025-04-10T16:06:36.257Z","avatar_url":"https://github.com/thbar.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Petite-lettre is a little gem allowing YAML communication between a process and the child it launches.\n\nh1. USAGE\n\nThe parent process launches its child and passes it a message using this kind of code:\n\n\u003cpre\u003e\u003ccode\u003ePetiteLettre.call(\"ruby child_program.rb\", { :command =\u003e :start_sale, :isbn =\u003e \"1234567\", :price =\u003e 12.4 })\n\u003c/code\u003e\u003c/pre\u003e\n\nThe child process read the parent message using this kind of code:\n\n\u003cpre\u003e\u003ccode\u003ePetiteLettre.receive do |message|\n  response = {}\n  if message[:command] == :start_sale\n    # do something here\n    raise \"Price is too low\" if message[:price] \u003c 15.0\n    response[:status] = \"OK\"\n    response[:transaction_id] = \"1235\"\n  else\n    raise \"Unknown command '#{message[:command]}'\"\n  end\n  response\nend\n\u003c/code\u003e\u003c/pre\u003e\n\nPetite-lettre uses $stdin and $stdout by default, although these can be customized with PetiteLettre.receive(input,output).\n\nh1. MORE USAGE\n\nNothing stops you from writing a child process in another language (ie: C#, Java), as long as it knows how to read YAML from $stdin and output YAML on $stdout. Just the same - you can write a parent process in another language.\n\nSee petite_lettre.rb for implementation details.\n\nh1. HISTORY\n\nPetite-lettre is born out of the need to communicate between a MRI/Shoes front-end and a JRuby/Celerity back-end.\n\nI'm pretty sure there is something already available out there to do that kind of things already. I just could not find them in a reasonable amount of time.\n\nIf it's the case, please mail me so I can bury petite-lettre for ever.\n\nh1. CREDITS\n\nI think I got that idea after using CouchDB for a while. I believe CouchDB uses JSON to communicate between its processes.\n\nh1. IDEAS\n\n* create a C# or Java client\n* allow continuous communication (à la server)\n* throw petite-lettre to the bin if I discover something that does the same thing at the same level of simplicity\n\nh1. COPYRIGHT\n\nCopyright (c) 2008 Thibaut Barrère. See LICENSE for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthbar%2Fpetite-lettre","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthbar%2Fpetite-lettre","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthbar%2Fpetite-lettre/lists"}