an example of future composition in a real app

24
An example of in a real app Future composition Phil Calçado SoundCloud

Upload: phil-calcado

Post on 16-May-2015

2.007 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: An example of Future composition in a real app

An example of

in a real app

Future composition

Phil CalçadoSoundCloud

Page 2: An example of Future composition in a real app

mothershipthe

Page 3: An example of Future composition in a real app

api.soundcloud.com

Page 4: An example of Future composition in a real app

api.soundcloud.comSearch

Msgs Metadata

Groups

Stats

Playlists

Page 5: An example of Future composition in a real app

api.soundcloud.com

MetadataPlaylists SearchSocial˝Graph

Messages StatsGroups

Page 6: An example of Future composition in a real app

parallelismdoesn’t like

Rails

Page 7: An example of Future composition in a real app

time

parallelism is like

Page 8: An example of Future composition in a real app

time

concurrency is like

Page 9: An example of Future composition in a real app

time

ideal is like

Page 10: An example of Future composition in a real app

time

rails is like

Page 11: An example of Future composition in a real app

sequentialuse case #1

Page 12: An example of Future composition in a real app

concurrentuse case #2

Page 13: An example of Future composition in a real app

enter

Page 14: An example of Future composition in a real app

sequentialuse case #1

Page 15: An example of Future composition in a real app
Page 16: An example of Future composition in a real app

maybe more readable

Page 17: An example of Future composition in a real app

concurrentuse case #2

Page 18: An example of Future composition in a real app

not concurrent!

Page 19: An example of Future composition in a real app

ah!

Page 20: An example of Future composition in a real app

example

Page 21: An example of Future composition in a real app

example

Page 22: An example of Future composition in a real app

example

50 or so 10-40ms requests

total response time is 152ms

Page 23: An example of Future composition in a real app

challenge:interesting

how to detect/type missed concurrency opportunities?˝aka. for comprehension abuse

Page 24: An example of Future composition in a real app

phil calçado

http://philcalcado.com˝@pcalcado˝

www.soundcloud.com˝