This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type MessageBase struct { | |
val1, val2 uint64 | |
} | |
type Message1 struct { | |
MessageBase | |
} | |
func (m *MessageBase) String() string { | |
return fmt.Sprintf("%s{Val1: %d Val2: %d}", ???, m.val1, m.val2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func convertIntoSystemMessage(jsonMap map[string]interface{}) ( | |
msg SystemMessage, err os.Error) { | |
// grab name from message | |
switch name { | |
case "LoginMessage": | |
... | |
case "LogoutMessage": | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "time" | |
type AnInterface interface { | |
GetRequestId() uint64 | |
} | |
type MessageBase struct { | |
RequestId uint64 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Writes data to a channel without blocking if and only if the consumer is still alive | |
// The consumer provides a stop channel; if this channel is closed it is interpreted that the consumer no longer wants the data | |
// If data is written then this function returns true | |
func Write(data interface{}, stopChan chan interface{}, sendChan chan interface{}) (written bool, err error) { | |
select { | |
case _, ok := <-stopChan: | |
if !ok { | |
err = errors.New("consumer terminated") | |
log.Printf("chwr: %s", err.Error()) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
subprojects { | |
if (name == 'samples') { | |
return | |
} | |
apply plugin: 'java' | |
apply plugin: 'maven-publish' | |
// rest of build script follows... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:libraft-agent:generatePomFileForMavenJavaPublication | |
:libraft-core:compileJava UP-TO-DATE | |
:libraft-core:processResources UP-TO-DATE | |
:libraft-core:classes UP-TO-DATE | |
:libraft-core:jar UP-TO-DATE | |
:libraft-agent:compileJava UP-TO-DATE | |
:libraft-agent:processResources UP-TO-DATE | |
:libraft-agent:classes UP-TO-DATE | |
:libraft-agent:jar UP-TO-DATE | |
:libraft-core:javadoc UP-TO-DATE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2014-02-14 16:38:58 | |
Full thread dump OpenJDK 64-Bit Server VM (20.0-b12 mixed mode): | |
"SIGTERM handler" daemon prio=10 tid=0x00007f4508118000 nid=0x1379 waiting for monitor entry [0x00007f44e72f2000] | |
java.lang.Thread.State: BLOCKED (on object monitor) | |
at java.lang.Shutdown.exit(Shutdown.java:195) | |
- waiting to lock <0x00000000f5be1fe0> (a java.lang.Class for java.lang.Shutdown) | |
at java.lang.Terminator$1.handle(Terminator.java:52) | |
at sun.misc.Signal$1.run(Signal.java:212) | |
at java.lang.Thread.run(Thread.java:701) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2014-02-18 05:51:15 | |
Full thread dump OpenJDK 64-Bit Server VM (20.0-b12 mixed mode): | |
"SIGINT handler" daemon prio=10 tid=0x00007fe1fc13a000 nid=0x4d35 waiting for monitor entry [0x00007fe1e09c9000] | |
java.lang.Thread.State: BLOCKED (on object monitor) | |
at java.lang.Shutdown.exit(Shutdown.java:195) | |
- waiting to lock <0x00000000f5be2358> (a java.lang.Class for java.lang.Shutdown) | |
at java.lang.Terminator$1.handle(Terminator.java:52) | |
at sun.misc.Signal$1.run(Signal.java:212) | |
at java.lang.Thread.run(Thread.java:701) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
src | |
+-- main.rs | |
+-- mylib/ | |
+-- mod.rs | |
+-- errors.rs | |
+-- types.rs | |
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate serde_codegen; | |
use std::env; | |
use std::path::Path; | |
fn main() { | |
let out_dir = env::var_os("OUT_DIR").unwrap(); | |
let src = Path::new("src/serde_types.in.rs"); | |
let dst = Path::new(&out_dir).join("serde_types.rs"); |
OlderNewer