Skip to content

Instantly share code, notes, and snippets.

@juancho088
Created June 10, 2018 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juancho088/42ab0f8d089421d23e6de8c36314a254 to your computer and use it in GitHub Desktop.
Save juancho088/42ab0f8d089421d23e6de8c36314a254 to your computer and use it in GitHub Desktop.
Dispatcher interface for Kotlin
package com.myblockbuster.core.dispatchers
/**
* Dispatcher on charge of routing our client request to the correct function
* @param K Key type
* @param T Return object type
*/
interface Dispatcher<in K, out T> {
/**
* Function that finds and executes a specific function given a {@link K} unique key
* returning a {@link T} result object
* @param key Unique key to find and execute a function
* @return T
*/
fun locate(key: K): T?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment