Clojure functions v

Post on 11-Nov-2014

732 views 0 download

Tags:

description

Clojure, Function, FP, Functional, java, jvm

transcript

3 functions (agent, send, add-watch) functions Fun with 4Clojure

@diego_pacheco

@diego_pacheco

diego-pacheco.blogspot.com

Yes, I’m a geek guy.

(And I like dinosaurs)

github.com/diegopacheco

Respect The REPL

Remember…

Remember…

(NO enterprise java Bullshit PLEASE)

Agents (reactive not autonomous: no imperative message loop and no blocking receive)

Refs Agents

coordinated independent

synchronous asynchronous

change of multiple locations change of individual locations

single storage location single storage location

mutation within a transaction mutation as a result of an action

STM Integrated with STM

Async Functions

prevent shutdown

Agents are…

Data structures that is associated with a pool of threads.

agent

What is the issue here ?

agent

What is the issue here ?

NONE

send

What is the issue here ?

send

What is the issue here ?

JVM blocks

add-watch

"[Agent Log] Key: :logger Agent: clojure.lang.Agent@da6bf4 old-value: 30 new-value: 31""[Agent Log] Key: :logger Agent: clojure.lang.Agent@da6bf4 old-value: 31 new-value: 32"

4Clojure.com

+10 Problems Solved+Share 3 Solutions

+30 Problems Solved

Solution 1

Solution 2

Solution 3

Recommended Books

(pr “Thanks All Folks”)

@diego_pacheco