-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* dev: Bump version and readme rename Filter::from_pointer and from_closure to pointer and closure Touch up documentation Clean up algorithm in Pharos::notify Re-use unused slots in vector in Pharos. Add `storage_len` and `num_observers` to Pharos. Let user decide the initial capacity of the vector used to store observers in Pharos Add docs Don't expose error type publicly since we don't use it in the API Complete redesign of the API. Switch to an enum Filter allowing to take both fn pointer and boxed closure as filter Add filter functionality, yipy Run bounded and unbounded notify concurrently and add an integration test for that Cleanup tests
- Loading branch information
Showing
17 changed files
with
1,628 additions
and
379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ package: | |
# - merge dev branch into master | ||
# - create git tag | ||
# | ||
version : 0.2.2 | ||
version : 0.3.0 | ||
name : pharos | ||
authors : [ Naja Melan <[email protected]> ] | ||
edition : '2018' | ||
|
@@ -42,5 +42,10 @@ badges: | |
|
||
dependencies: | ||
|
||
futures-preview: { version: ^0.3.0-alpha } | ||
futures-preview : { version: ^0.3.0-alpha, features: [async-await, nightly] } | ||
pin-project : ^0.4.0-beta | ||
|
||
|
||
dev-dependencies: | ||
|
||
assert_matches: ^1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
# TODO | ||
|
||
- Create a filter possibility. Let users provide a closure with a predicate to filter which events they want to receive. | ||
The reasons for doing this in pharos are: | ||
|
||
- It's unwieldy to do this in the client because of the unwieldy type that you need to annotate if you need to store | ||
the stream (FilterMap will include a closure in it's type) | ||
- performance. If filtering happens on the client side, we will clone and send out events they are not interested in. | ||
By doing it in pharos, we can avoid that. | ||
- make Events clone? means we can only work with broadcast channels | ||
|
||
- switch to more performant channels (crossbeam). Will be easier once they provide an async api. | ||
|
||
- allow other channel types, like a ringchannel which drops messages on outpacing? To prevent DDOS and OOM attacks? | ||
|
||
- scaling? For now we have an ever growing vector of observers | ||
|
||
- other data structure than vec? smallvec? | ||
- type that allows concurrent access to &mut for each observer, so we can mutate in place rather than have join_all allocate a new vector on easch notify. Maybe partitions crate? -> has 19 lines of unsafe code, needs review. | ||
- let users set capacity on creation? |
Oops, something went wrong.