Commit Graph

41 Commits

Author SHA1 Message Date
Derrick Hammer e0170f9dfc
*make message encoding/decoding async for use with the kernel 2023-04-08 21:09:49 -04:00
Derrick Hammer 912150c6e4
*Add missing pushInfos 2023-04-07 12:22:03 -04:00
Derrick Hammer f9955c18d2
*we don't need a slave mode, just use this async fork on the slave webworkers 2023-04-07 03:34:19 -04:00
Derrick Hammer 2f0deaf2bf
*__get should not be async 2023-04-07 02:15:02 -04:00
Derrick Hammer 702a859661
*refactor to use a a proxy function for createChannnel and _get so that it promises are only used in slave mode 2023-04-07 01:48:06 -04:00
Derrick Hammer 05c91000e1
*Fix api call 2023-04-07 01:32:53 -04:00
Derrick Hammer 2b1789f963
*Move slave checks inside sync functions 2023-04-07 01:32:35 -04:00
Derrick Hammer 5094ec4b26
*add syncing for info
*need to make createChannel async
2023-04-07 01:28:54 -04:00
Derrick Hammer 98bb74d8b1
*Change userData logic to throw error if set, but try to always set it 2023-04-06 22:53:15 -04:00
Derrick Hammer e0178e41ed
_slave is on _mutex on channel 2023-04-06 22:04:27 -04:00
Derrick Hammer 1387b060a4
use this.stream 2023-04-06 17:29:29 -04:00
Derrick Hammer 54904ab1ad
*Bug fix pushRemote 2023-04-06 17:24:06 -04:00
Derrick Hammer ab4632b644
*_mux doesnt exist in Protomux 2023-04-06 17:22:18 -04:00
Derrick Hammer 2b645af1e9
*Bug fix slave 2023-04-06 17:10:08 -04:00
Derrick Hammer eb4a8f1c9e
Revert "*Change pullRemote to throw if the item is not empty"
This reverts commit 74b0f1d596.
2023-04-06 16:21:30 -04:00
Derrick Hammer 74b0f1d596
*Change pullRemote to throw if the item is not empty 2023-04-06 16:20:20 -04:00
Derrick Hammer bef4631c30
*Switch sync approach. sync state properties ondemand before and after accessing them 2023-04-06 15:58:39 -04:00
Derrick Hammer f457294772
*Add concept of being a slave
*on _onopensession, if we are a slave, sync before checking _remote
2023-04-06 14:21:01 -04:00
Derrick Hammer 81eac54453
Revert "Revert "*make syncing async""
This reverts commit d37d37048c.
2023-04-06 14:15:39 -04:00
Derrick Hammer d37d37048c
Revert "*make syncing async"
This reverts commit 5907966d
2023-04-06 13:26:20 -04:00
Derrick Hammer d7dede7894
*need to use _mux on Channel calls to syncState 2023-04-05 20:03:12 -04:00
Derrick Hammer 5907966d77
*make syncing async 2023-04-05 17:46:07 -04:00
Derrick Hammer 6cb9fd8283
*add calls to this.syncState?.() which may be dynamically set higher in the stack to sync the state of the channels and messages 2023-04-05 03:45:10 -04:00
Derrick Hammer bbe30a3de5
*prettier 2023-04-05 03:36:37 -04:00
Mathias Buus 78e83bbfa9 failing test 2023-01-13 14:08:34 +01:00
Ar Nazeh 43d5192f31
Deduplicate muxer for a given same stream. (#5)
* docs: add documentation for iterating over channels

* fix: deduplicate protomux instances for the same stream

creating multiple channels on multiple muxers for the same stream closes
channels accidently see
[here](https://gist.github.com/Nazeh/a3f1d24b597913303afcb6c568f4b042)

* fix: deduplicate muxers on the same stream

opening multiple channels on multiple muxers causes channels to either
close or reset, see
[here](https://gist.github.com/Nazeh/a3f1d24b597913303afcb6c568f4b042)

* use userData
2022-08-31 12:49:19 +02:00
Kasper Isager Dalsgarð 88df528516
Add `aliases` option (#4)
* Add `aliases` option

* Clear aliases on GC
2022-08-13 00:52:34 +02:00
Mathias Buus 5606c5ef85 auto split corks if they get too big 2022-07-06 14:39:04 +02:00
Mathias Buus c98b9489fa end on end 2022-03-24 15:19:55 +01:00
Mathias Buus 0e5095aa35 re-add destroy 2022-03-11 19:46:06 +01:00
Mathias Buus 21415211e7 session -> channel and make open explicit for easier control 2022-03-11 13:55:39 +01:00
Mathias Buus 8aff462da3 add isProtomux helper 2022-03-11 02:18:31 +01:00
Mathias Buus 22acc08aa1 set backlog to infinity for now 2022-03-11 02:11:45 +01:00
Mathias Buus b3b9565081 context should be the first arg 2022-03-11 02:09:55 +01:00
Mathias Buus b266f01bf2 pass session to onopen/onclose and ondestroy for consistency 2022-03-10 23:38:18 +01:00
Mathias Buus 576e08180f move to sessions 2022-03-10 23:08:37 +01:00
Mathias Buus e2d05941d6
use message object api (#1) 2022-02-01 19:09:56 +01:00
Mathias Buus 534c417ed0 Protomux.from 2022-01-28 16:00:09 +01:00
Mathias Buus 45e10f4bec rewrote it 2021-12-30 21:13:47 +01:00
Mathias Buus c70c9f989f fix some bugs, iterate the api 2021-12-27 16:09:34 +01:00
Mathias Buus ce309533f4 first commit 2021-11-10 15:15:09 +01:00