Commit Graph

23 Commits (master)

Author SHA1 Message Date
David Kebler 31747cc373 0.5.0 bumping in anticipation of 3-2020 deployment of light code
working fine, no bugs
cleaned code
refactored socketsInit and how it handles the ready object, delays 100ms to avoid pushing/send issue when socket is closed abruptly
refactored the observer names to add a suffix be more clear like <listening> for sockets  and <inbound> and <outbound> for consumers
add better examples  two consumers and socket example and duplex example
2020-03-15 16:06:27 -07:00
David Kebler 23ea81c9d9 0.1.29 add default return command for socket/servers
add generic client and ack sockect server examples
2019-09-13 19:05:36 -07:00
David Kebler 10c4f4a146 0.1.27 add bubble up 'status' event on every socket
add in latest websocket client example
2019-09-08 20:14:40 -07:00
David Kebler 3bf0110164 0.1.26
refactored amend methods
added transport validation
changed default name spaces to all start with _ to avoid accidential namespace issues
refactored examples to showcase all possibilities with a four in one (fio) example
refactored ha hooks
added matching websocket client
all works changes made by one socket are pushed to all sockets where they do their updates including home assistant
added a home assistant package file including lovelace yaml for matching HA interface.
2019-08-28 09:15:02 -07:00
David Kebler 21718d3998 0.1.25 Update all deps, add home assistant mqtt example 2019-08-15 13:39:35 -07:00
David Kebler ea1342272e 0.1.20
changed default commands handling, removed _default namespace
changed s and c name spaces to use ._c, and _s as default name spaces
amend commands work with above ._c and ._s props
changed .socket to ._socket to avoid namespace issues with instances using .socket.  Instances should use the getSocket method!
copied host and port options to connect. for mqtt socket to make setting those more standard
cleaned up logging
Add hooking for before send, and before and after process
Improved/cleaned preempting default processing
2019-04-27 12:10:56 -07:00
David Kebler 1359aa7d31 0.1.17 add removeSocket method, add final catch of all packet processing errors. 2019-03-17 13:55:29 -07:00
David Kebler 0a86774b17 0.1.16 update utility dependencies, improve the fio example so mqtt work correctly 2019-02-15 08:51:07 -08:00
David Kebler 759949fb51 Refactored init method and added an "addSocket" method called from there.
This allows setting up sockets at construction or later at runtime via same call to addSocket.
2019-01-01 16:39:08 -08:00
David Kebler 10077e207b began documentation in readme
by default removed root namespace checking must now set useRootNS to true to access command functions there.  This to avoid issuess like an 'on' function clashing with an emitter listerner.
2018-05-25 14:40:08 -07:00
David Kebler ea8253f4b0 added in mqtt as socket type
refactored with addSocket and initSocket for individual sockets
now can do runtime socket addition after init
2018-05-20 15:44:31 -07:00
David Kebler 04268d2b9c refactor for allowing dynamic addition of sockets
add websocket (listener) to socket transports
improved integration of mqtt transport with topic being translated to cmd and vice versa
2018-05-16 11:17:38 -07:00
David Kebler 78bcf3009a update to esm from @std/esm 2018-05-16 07:08:14 -07:00
David Kebler 5a0af4d75e add mqtt client as option to uci-base with uci-mqtt 2018-04-05 15:35:29 -07:00
David Kebler d0173c045f With changes in socket module now send is async and returns the response from the socket.
send now transport send now process as many consumer sockets as have been created by pushing them onto array and the using promise.all and map to send out together.
Return for one than one is an array of responses.
getPacketByName was added to make it easy to grab just one of those in returned array.
2018-02-13 14:19:18 -08:00
David Kebler b938647efe improved namespace handling and added transport namespacing
added / delimiter to command/subcommand
2018-02-06 20:40:00 -08:00
David Kebler ddd81ea671 refactored processing and packet command function lookup based on priortized namespaces. Packets can now have subcommands by use using . or : which will look in sub keys for the command sub function 2018-02-05 22:05:38 -08:00
David Kebler e5059368a9 changed sockets options now can add as many as you want of either type and transport
improved socket packet processing call now binds this and name of socket that received packet for processing
single common processor for all packets incoming (either consumer or socket)
default processing splits into socket or consumer
default processing has calls looking for packet cmd functions before returning error packet
1. Added Namespace // TODO
2. A Pariticular Sockect
3. Root of instance
4. The socket type and transport //TODO
5. The socket type
there are helper functions for adding cmd functions to any of these save the root instance we you can add directly.
2018-02-04 14:18:21 -08:00
David Kebler 8c61ec854d refactored adding sockets so as many sockets of any type and transport can be added 2018-02-02 14:09:52 -08:00
David Kebler 9679f61aae moved default processing to constructor
push creates and connects to array and use promise.all
cleanup amend and register functions
alter send function and add sendTCP and sendIPC
2018-01-30 21:12:38 -08:00
David Kebler 3c1340baf0 fixed separation of packet properties for each socket type when customizing
add amendPacket.. and changed registerPacket to accept single type changes

The four-in-one example now using amend and register sucessfully
2018-01-29 21:52:24 -08:00
David Kebler a83646c4f6 refactor base so it works with latest uci-socket
four-in-one example working
make Base instance (this) the default context for all socket packet commands
2018-01-28 22:37:54 -08:00
David Kebler 3015798068 Nearly functional uci base module
supports one each unix tcp sockets and clients in any combination with default and custom packet processing
2018-01-18 21:32:07 -08:00