Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Agent #95

Closed
Odomontois opened this issue Dec 27, 2019 · 3 comments
Closed

Implement Agent #95

Odomontois opened this issue Dec 27, 2019 · 3 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@Odomontois
Copy link
Member

Odomontois commented Dec 27, 2019

Implement new concurrent datatype Agent mostly like RefM from ZIO and looking like Ref + Semaphore (Atom + Gatekeeper) for everything else

It should have at least following methods

trait Agent[F[_], A]{
  // return current value, this will never block
  def get: F[A]
  // update value with effectful transformation, wait for the new result
  def updateM(f: A => F[A]): F[A]
  // enqueue transformation, return immediately
  def fireUpdateM(f: A => F[A]): F[Unit]
  // modify value with effectful transformation, wait for the new result
  def modifyM[B](f: A => F[(A, B)]): F[B]
}
@susliko
Copy link
Contributor

susliko commented Jan 10, 2020

Working on this

@susliko
Copy link
Contributor

susliko commented Jan 12, 2020

PR
#107

@Odomontois
Copy link
Member Author

Closing for now, since simple version has been delivered.
We'll wait for your more advanced implementation @susliko

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants