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

mux: MakeBearer interface #4260

Merged
merged 1 commit into from
Jan 18, 2023
Merged

mux: MakeBearer interface #4260

merged 1 commit into from
Jan 18, 2023

Conversation

coot
Copy link
Contributor

@coot coot commented Jan 9, 2023

Provide a Bearer type class. The main function is makeBearer
which constructs a MuxBearer with the defaultSDUSize. The
makeBearer' function is useful for testing preposes. Although all
instances are pure, we need to return a monadic action to accommodate
bearer for simulated snocket in Simulation.Network.Snocket.

The goal is to remove toBearer method from Snocket interface.

TODO:

  • Update CHANGELOG.md files

@coot coot added networking technical debt mux issues related to network-mux labels Jan 9, 2023
@coot coot force-pushed the coot/mux-bearer branch 3 times, most recently from 622a52f to 24a7ccd Compare January 10, 2023 12:27
@coot coot marked this pull request as ready for review January 10, 2023 12:27
@coot coot requested review from bolt12 and nfrisby as code owners January 10, 2023 12:27
@coot coot force-pushed the coot/mux-bearer branch 2 times, most recently from 581e072 to 82c4e09 Compare January 10, 2023 21:44
Copy link
Contributor

@bolt12 bolt12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Comment on lines +55 to +56
-> DiffTime -> Tracer m MuxTrace -> fd -> m (MuxBearer m)
pureBearer f = \sduTimeout tr fd -> pure (f sduTimeout tr fd)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can also do 😛

Suggested change
-> DiffTime -> Tracer m MuxTrace -> fd -> m (MuxBearer m)
pureBearer f = \sduTimeout tr fd -> pure (f sduTimeout tr fd)
-> (DiffTime -> Tracer m MuxTrace -> fd -> m (MuxBearer m))
pureBearer f = fmap (fmap (fmap pure)) f

@coot coot force-pushed the coot/mux-bearer branch 4 times, most recently from 24d2da8 to 419d2ab Compare January 12, 2023 20:26
@coot coot changed the title mux: Bearer type class mux: MakeBearer interface Jan 16, 2023
Provide a `MakeBearer` newtype: a function to constructs a `MuxBearer`.
Although all instantiations are pure, we need to return a monadic action
to accommodate bearer for simulated snocket in
`Simulation.Network.Snocket`.

The `MakeBearer` function provides default `SDUSize`s.  One can still
use a custom size by using one of the low level `*AsMuxBearer` functions.

We remove `toBearer` method of the `Snocket` api.
@coot
Copy link
Contributor Author

coot commented Jan 18, 2023

bors merge

iohk-bors bot added a commit that referenced this pull request Jan 18, 2023
4260: mux: MakeBearer interface r=coot a=coot

Provide a `Bearer` type class.  The main function is `makeBearer`
which constructs a `MuxBearer` with the `defaultSDUSize`.  The
`makeBearer'` function is useful for testing preposes.  Although all
instances are pure, we need to return a monadic action to accommodate
bearer for simulated snocket in `Simulation.Network.Snocket`.

The goal is to remove `toBearer` method from `Snocket` interface.

TODO:
* [ ] Update `CHANGELOG.md` files


Co-authored-by: Marcin Szamotulski <coot@coot.me>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 18, 2023

Build failed:

@coot
Copy link
Contributor Author

coot commented Jan 18, 2023

bors merge

iohk-bors bot added a commit that referenced this pull request Jan 18, 2023
4260: mux: MakeBearer interface r=coot a=coot

Provide a `Bearer` type class.  The main function is `makeBearer`
which constructs a `MuxBearer` with the `defaultSDUSize`.  The
`makeBearer'` function is useful for testing preposes.  Although all
instances are pure, we need to return a monadic action to accommodate
bearer for simulated snocket in `Simulation.Network.Snocket`.

The goal is to remove `toBearer` method from `Snocket` interface.

TODO:
* [ ] Update `CHANGELOG.md` files


Co-authored-by: Marcin Szamotulski <coot@coot.me>
@coot coot self-assigned this Jan 18, 2023
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 18, 2023

Build failed:

@coot
Copy link
Contributor Author

coot commented Jan 18, 2023

bors merge

@iohk-bors iohk-bors bot merged commit a3de411 into master Jan 18, 2023
@iohk-bors iohk-bors bot deleted the coot/mux-bearer branch January 18, 2023 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mux issues related to network-mux technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants