Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 695953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:00:47+00:00 2026-05-14T03:00:47+00:00

I need to read and write some data through named pipes. I have tested

  • 0

I need to read and write some data through named pipes.

I have tested it in a simple Ruby app, and it works nice.

But I dont know, where should i put it in my Rails app? I have heard about Rake tasks, but i don’t sure, is it right solution.

I need to open a pipe-file, and listen to data. If there is any, i need to process it and make a DB-query. Then, write some data to another pipe. I know, how it works, but the only problem – how to run it with Rails? Give me some examples, please.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:00:47+00:00Added an answer on May 14, 2026 at 3:00 am

    It sounds like you have a website that will have a backend source of data that you are streaming through a pipe. It also sounds like this is not going to be part of the HTTP Request/Response cycle, which could make a rake task a good choice.

    Make a file in lib/tasks called listener.rake

    it should look like this:

    desc 'Listens to pipe and does stuff'
    task :listen_to_pipe => :environment do
      puts "Listen to Pipe starting"
      #open pipe
      #loop to listen to it
        puts "going to do stuff"
        #do stuff
      #end
    end
    

    Then, from the command line in the root dir of your project you can invoke it like this:

    rake listen_to_pipe
    

    and for a different environment, do this:

    rake listen_to_pipe RAILS_ENV=production
    

    This task will have access to all your models. To end it, hit Ctrl+C

    Keep in mind you will need to stop & restart the process to load any changes made to models.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application where i need to write some data to the serial
I have a problem. I need to trace all read/write operations to the registry
I need to write a simple program for work that does the following: read
As the title says, I need to write a small program to read data
I'm trying to upload a file via URLConnection, but I need to read/write it
I need to read and write octet streams to send over various networks to
For a project I need to read and write ESRI shapefiles. It should be
I need to read from and write to Excel spreadsheets using Delphi 2010. Nothing
If I am using ReaderWriterLockSlim to acquire read/write locks, do I need to make
After spending some hours with the Ruby Debugger I finally learned that I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.