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 6769125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:09:21+00:00 2026-05-26T15:09:21+00:00

if i want to implement am http server. i create new actor per request.

  • 0

if i want to implement am http server.

i create new actor per request. So it can scale up as my cpu updated.

but will it cause memory usage problem? it is said that actor have some strange behavior while gc.
the code will be somehow like that:

class Worker extends Actor {
    def act = react {
       case req : Request => perform(req);exit()
    }
}


class HttpEventHandler{
   def onConnect(conn) = {
       new Worker ! createRequest(conn)
   }      
}

Edit: i made a test about this, check my test in detail http://jilen.iteye.com/blog/1231178

  • 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-26T15:09:22+00:00Added an answer on May 26, 2026 at 3:09 pm

    Lift had some problems with Scala’s built-in actor library a couple of years ago, which prompted them to write their own actor library. I have no idea whether Scala’s built-in actors still have the same problems the Lift community experienced back then. You’ll have to do your own testing to find out. (Or maybe someone with recent experience can chime in).

    I do recommend checking out the Akka Actors library. Overall, I think it’s an improvement to Scala’s built-in implementation. It even has a spawn function, which does exactly what you’re doing here (creating an actor to process a single message and die).

    Edit:

    You code listing in particular will probably leak actors, since you do not explicitly exit() your actors when you’re done with them.

    Edit 2:

    Turns out that Scala itself has a spawn function (Thanks Stefan). I don’t know if it behaves any better than Scala actors.

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

Sidebar

Related Questions

I want to implement HTTP Basic Authentication for my web services, but I also
I want to implement a Java HTTP server locally, I mean the server computer
I want to implement HTTP streaming server, which is similar to this (http://www.ioncannon.net/programming/452/iphone-http-streaming-with-ffmpeg-and-an-open-source-segmenter/) But,
I want to implement a version of Benford's law ( http://en.wikipedia.org/wiki/Benford%27s_law ) that basically
I want implement in my software solution an VBA editor but in c# 3.0.
I want to create one simple application for sending request from iphone(client) by using
I want to implement downloading (with AJAX) of uploaded file from server. On the
I want to implement something like autocomplete feature like this: http://jqueryui.com/demos/autocomplete/ However I cannot
I need to create a program that receives HTTP request and forwards those requests
I'm trying to create a simple CalDav server using ASP.NET MVC 3, but the

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.