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

  • Home
  • SEARCH
  • 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 3230900
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:58:53+00:00 2026-05-17T16:58:53+00:00

I came across this really nice looking Scala code while researching XMPP for a

  • 0

I came across this really nice looking Scala code while researching XMPP for a .Net project we’re working on:

object Main {

  /**
   * @param args the command line arguments
   */
  def main(args: Array[String]) :Unit = {
      new XMPPComponent(
        new ComponentConfig() {
            def secret() : String = { "secret.goes.here" }
            def server() : String = { "communitivity.com" }
            def subdomain() : String = { "weather" }
            def name() : String = { "US Weather" }
            def description() : String = { "Weather component that also supported SPARQL/XMPP" }
        },
       actor {
        loop {
            react {
                case (pkt:Packet, out : Actor) =>
                    Console.println("Received packet...\n"+pkt.toXML)
                    pkt match {
                        case message:Message =>
                            val reply  = new Message()
                            reply.setTo(message.getFrom())
                            reply.setFrom(message.getTo())
                            reply.setType(message.getType())
                            reply.setThread(message.getThread())
                            reply.setBody("Received '"+message.getBody()+"', tyvm")
                            out ! reply
                        case _ =>
                            Console.println("Received something other than Message")
                    }
                 case _ =>
                    Console.println("Received something other than (Packet, actor)")
            }
        }
       }
    ).start
  }
}

(This was taken from http://github.com/Communitivity/MinimalScalaXMPPComponent/blob/master/src/org/communitivity/echoxmpp/Main.scala)

The actor and pattern matching stuff looks like a really nice way to write components in a scalable way. I haven’t been able to find any C# actors libraries that look mature, and learning Axum seems like overkill.

What would be the right way to attack this in C#? (ignoring the XMPP specific code, of course – I’m more interested in what the C# version of actors and pattern matching would look like).

  • 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-17T16:58:54+00:00Added an answer on May 17, 2026 at 4:58 pm

    There are Actor like libraries avaliable for .NET see retlang for one, also F# agents are similar.

    Also see this question.

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

Sidebar

Related Questions

I came across this code today AsyncInvoke(OnTimeMessageTimer, (object)null, (ElapsedEventArgs)null); Is there anything wrong with
I came across this (really) simple program a while ago. It just outputs the
While stumbling through the chromium code documentation, I came across this post: http://code.google.com/p/chromium/wiki/UsingGit#Windows If
I just came across a C++ SDK that makes heavy use of this really
I came across this class while reading a C# book and have some questions.
I came across this snippet of code on MSDN: entityBuilder.Metadata = @res://*/AdventureWorksModel.csdl| res://*/AdventureWorksModel.ssdl| res://*/AdventureWorksModel.msl;
folks. So, I've came across this compilation error a while ago.. As there's an
3 Years ago I came across a really nice script. It was just an
I came across this issue recently and thought it was really helpful. My question
recently I came across this term,but really have no idea what it refers to.I've

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.