Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

relay_supervisor

A supervisor where older children can pass data to younger children!

Package Version Hex Docs

This is useful any time a child needs to make use of another. For example, if you have a web server that uses a database connection.

gleam add relay_supervisor@1
import relay_supervisor as relay

fn start(credentials: String, hostname: String) -> _ {
  relay.new(fn(children) {
    children
    |> relay.add(
      relay.child(database.template)
      |> relay.providing(fn(_state) { credentials })
      |> relay.returning(fn(_state, db) { db })
    )
    |> relay.add(
      relay.child(web_server.template)
      |> relay.providing(fn(db) { #(db, hostname) })
    )
  })
}

See HexDocs for an explanation of this code and for further documentation.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages