The second step is to add the logic to do the searches properly. Let's create the package co.starcarr.rssreader.search and place the file Searcher.kt inside it:
Now we will create the class Searcher inside it, and include a function that will return a ReceiveChannel<Article>, given a query. Notice that we want to return a ReceiveChannel so that the caller doesn't use this channel to send information:
class Searcher() {
fun search(query: String) : ReceiveChannel<Article> {
val channel = Channel<Article>(150)
return channel
}
}