Commit Graph

32 Commits (master)

Author SHA1 Message Date
Kebler Network System Administrator 439b5dbd7e gather port or path option into proper socket entry
last commit before major refactor for plugins
2021-04-05 17:35:57 -07:00
Kebler Network System Administrator 599b3242ea 0.5.5 added yaml file load of options 2021-03-11 16:25:17 -08:00
David Kebler da75d1a468 0.5.4 Full working removeSocket, removes also correpsonding s or c observers 2020-07-26 16:52:21 -07:00
David Kebler eee7a8f11e 0.5.2 return handle to newly added socket instead of just init function 2020-07-04 10:14:34 -07:00
David Kebler 93a5c72e5f 0.5.1 refactor send method to streamline all cases into one. Can accept name or array of consumer names to send otherwise it's all.
do some vetting of the packet to be processed to avoid processing a bad packet
set ready and state log levels for pushed or sent ready packets for easier debugging
2020-03-24 14:22:58 -07:00
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 55d93bf7d8 0.1.49 refactor push method now allows specification of sockets and consumers
has ready push for change and connect but they are buggy
2020-02-10 21:34:58 -08:00
David Kebler 709b3e0fbc 0.1.41 Fix bug in consumerConnected Method 2020-01-21 18:38:36 -08:00
David Kebler ddd7556c3f 0.1.40 clear console.logs 2020-01-18 22:29:49 -08:00
David Kebler 80286a2e4f 0.1.39
processing.js
  add ready command to consumer for pushes
  emitting entire packet
base.js
  added ready all subcriber that sends/push when ready
  adds ready packet to conPackets for all s socket types
  change observer names to include sufixes :socket, :consumer, :process,  :device
  add method to easily create an observer of connecting consumer(s)
2020-01-16 17:22:27 -08:00
David Kebler a6d928bf56 0.1.38
processing.js
  added default ready command for socket
  removed arrow functions from socket cmd functions must Always be regular functions for setting context
base.js
  better validation and defaults for options to registerSocket
  add by default a ready observer for when socket starts listening
2020-01-14 09:21:09 -08:00
David Kebler a47144606a 0.1.37
base:
  add ready observer class instance
  adds a ready observer for each consumer (only) registered
  refactored default namespace processing a bit
  refactored _packetProcess  the default/main processor
     now can register before,command, and after processors
     uses a single _process function to remove near reptition
     does a better job of maintaining/merging the packet from step to step
processing:
  change processor to cmdProcessor
  refactor default consumer processing
2020-01-06 23:39:58 -08:00
David Kebler 741823cce4 0.1.32 change buble up events to 'connection:socket' and 'connection:consumer' 2019-12-05 15:33:02 -08:00
David Kebler 2d552bc6c1 0.1.31
refactor init to socketsInit support old init
registerSocket now only registers a socket it does not initialize, addSocket now calls this for backwards compatibility
added active getter to all sockets/consumers so now ready getter returns complete active state of all sockets
socketsInit only attempts to init non active sockets so can be called multiple times
add some more helpers
getSocketsFilter, getConsumers, getSocketInit
push now supports push to specific sockets/servers instead of just all which is the default
2019-11-21 09:46:56 -08:00
David Kebler ec311b51df 0.1.30 add consumer connection bubble up listener for each socket
add mqtt s vs c option
2019-09-16 18:05:18 -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 61df3593b1 0.1.28 improve error handling of otherwise unhandled errors at processor call
bubble up 'pushed' events to base instance from underlying sockets
add error command to any packets returning packet.error to a consumer/client
2019-09-11 21:35:23 -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 1b3d5fceb7 refactored socket initialization to better catch and emit errors and remove offending sockets
will now emit 'error', 'warn', 'fatal'  when needed so instance can track and track easier and take action (like notification)
sockets will bubble these up now.
2019-08-29 13:41:32 -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 c1d35f7c0f 0.1.22 bump because of change in uci-socket 2019-05-01 15:38:20 -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 6da51d453f 0.1.19 add ack to default socket commands, add socketsListen and consumersListen and private _eventListen methods 2019-04-26 11:00: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 20d2eb09cc fix adding root namespace to lookups 2018-05-28 14:18:20 -07: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