This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
| <?xml version='1.0' encoding='utf-8'?> | |
| <Server port="8005" shutdown="SHUTDOWN"> | |
| <Service name="Catalina"> | |
| <Connector port="8080" protocol="HTTP/1.1" | |
| connectionTimeout="20000" | |
| redirectPort="8443" /> | |
| <Engine name="Catalina" defaultHost="localhost"> |
| /** | |
| * © 2012 Typesafe Inc. | |
| * | |
| * Extracted from http://doc.akka.io/docs/akka/2.1.0-RC2/scala/io.html | |
| */ | |
| import akka.actor._ | |
| import akka.util.{ ByteString, ByteStringBuilder } | |
| import java.net.InetSocketAddress |
| abstract class Product | |
| abstract class PizzaBuilder { | |
| var dough: String | |
| var sauce: String | |
| var topping: String | |
| def withDough(dough: String): PizzaBuilder | |
| def withSauce(sauce: String): PizzaBuilder | |
| def withTopping(topping: String): PizzaBuilder |
| name := "DES and AES encryption in Scala" | |
| version := "1.0" | |
| scalaVersion := "2.9.1" | |
| libraryDependencies += "commons-codec" % "commons-codec" % "1.6" |
| /** | |
| * Copyright (C) 2009-2010 Scalable Solutions AB <http://scalablesolutions.se>. | |
| */ | |
| package sample.chat | |
| import scala.collection.mutable.HashMap | |
| import akka.actor.{Actor, ActorRef} | |
| import akka.stm._ |