Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
NotificationsYou must be signed in to change notification settings

dgruntz/scala-async

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

scala-async is an attempt to implement something akin to C#'s async based on scala's delimited continuations and akka's Futures.

Example

/** Painless asynchronous programming with Swing. */object ReadmeExample extends SimpleSwingApplication {    val dlButton = new Button("Download")  val charCount = new TextField { text = "0"; columns = 5 }    def top = new MainFrame {    title = "Scala-Async Test"    contents = new FlowPanel(dlButton, new Label("# Chars"), charCount)  }  listenTo(dlButton)  reactions += {    case ButtonClicked(`dlButton`) =>       charCount.text = ""      async {        // No blocking is involved here!        val akka = await { downloadAsync("http://www.akka.io/") }        val scala = await { downloadAsync("http://www.scala-lang.org/") }        // Access swing components directly        charCount.text = (akka.length + scala.length).toString      }  }    /** Downloads the content of the given url asynchronously. */  def downloadAsync(url: String): Future[String] = { ... }    ...}

Check the fullReadmeExample.scala

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp