async ldap programming is full of promises!€¦ · copyright © 2015 forgerock, all rights...

8
Copyright © 2015 ForgeRock, all rights reserved. ASYNC LDAP PROGRAMMING IS FULL OF PROMISES! Ludovic Poitou Matthew Swift

Upload: others

Post on 08-Aug-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ASYNC LDAP PROGRAMMING IS FULL OF PROMISES!€¦ · Copyright © 2015 ForgeRock, all rights reserved. ForgeRock ForgeRock ForgeRockIdentity . Created Date: 11/13/2015 9:33:43 AM

Copyright © 2015 ForgeRock, all rights reserved.

ASYNC LDAP PROGRAMMING IS FULL OF PROMISES!

Ludovic Poitou Matthew Swift

Page 2: ASYNC LDAP PROGRAMMING IS FULL OF PROMISES!€¦ · Copyright © 2015 ForgeRock, all rights reserved. ForgeRock ForgeRock ForgeRockIdentity . Created Date: 11/13/2015 9:33:43 AM

Copyright © 2015 ForgeRock, all rights reserved. 2

What is Asynchronous

§ In Programming, Sync = Call, wait for result, process result. § Async: Non blocking, return immediately, callback on result.

Page 3: ASYNC LDAP PROGRAMMING IS FULL OF PROMISES!€¦ · Copyright © 2015 ForgeRock, all rights reserved. ForgeRock ForgeRock ForgeRockIdentity . Created Date: 11/13/2015 9:33:43 AM

Copyright © 2015 ForgeRock, all rights reserved. 3

Why Using Asynchronous ?

§ Blocking = Waiting § Use threads and parallelize

§  Too many threads implies context switching

§ All our machines now have many CPUs. Let’s keep them busy.

Page 4: ASYNC LDAP PROGRAMMING IS FULL OF PROMISES!€¦ · Copyright © 2015 ForgeRock, all rights reserved. ForgeRock ForgeRock ForgeRockIdentity . Created Date: 11/13/2015 9:33:43 AM

Copyright © 2015 ForgeRock, all rights reserved. 4

Promises

§ Instead of specifying a callback, return a Promise § Benefits:

§  Cleaner method signatures §  Uniform return/error semantic §  Easy composition §  Easy sequential/parallel join §  Always async §  Exception like error bubbling

Page 5: ASYNC LDAP PROGRAMMING IS FULL OF PROMISES!€¦ · Copyright © 2015 ForgeRock, all rights reserved. ForgeRock ForgeRock ForgeRockIdentity . Created Date: 11/13/2015 9:33:43 AM

Copyright © 2015 ForgeRock, all rights reserved. 5

Java LDAP Programming

§ JNDI §  Old and Strange Abstractions §  But part of Java by default §  Only synchronous APIs §  To parallelize work, use

Executors

Page 6: ASYNC LDAP PROGRAMMING IS FULL OF PROMISES!€¦ · Copyright © 2015 ForgeRock, all rights reserved. ForgeRock ForgeRock ForgeRockIdentity . Created Date: 11/13/2015 9:33:43 AM

Copyright © 2015 ForgeRock, all rights reserved. 6

OpenDJ LDAP SDK

§  Pure Java library §  Provides classes and methods for all LDAPv3 operations §  Support for LDIF reading / writing, Schema… §  Support for LDAP Controls and Extended Operations from many

servers §  Easy-to-use connection management, connection pooling, load

balancing §  Performance tools and examples §  Both Synchronous and Asynchronous methods based on Promises

Page 7: ASYNC LDAP PROGRAMMING IS FULL OF PROMISES!€¦ · Copyright © 2015 ForgeRock, all rights reserved. ForgeRock ForgeRock ForgeRockIdentity . Created Date: 11/13/2015 9:33:43 AM

Copyright © 2015 ForgeRock, all rights reserved. 7

Live Performing…

Sorry no violin ;)

Page 8: ASYNC LDAP PROGRAMMING IS FULL OF PROMISES!€¦ · Copyright © 2015 ForgeRock, all rights reserved. ForgeRock ForgeRock ForgeRockIdentity . Created Date: 11/13/2015 9:33:43 AM

Copyright © 2015 ForgeRock, all rights reserved.

ForgeRock

ForgeRock

ForgeRockIdentity

ForgeRock blog.forgerock.com

Forgerock.com

Thanks