-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b41c5e
commit 43332f3
Showing
18 changed files
with
138 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
include src/nasdaq_protocols/common/message/templates/*.mustache | ||
include src/nasdaq_protocols/tools/templates/*.mustache | ||
include src/nasdaq_protocols/fix/parser/templates/*.mustache | ||
include src/nasdaq_protocols/tools/templates/*.xml |
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
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
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from nasdaq_protocols.common import logable | ||
from nasdaq_protocols import fix | ||
|
||
|
||
@logable | ||
class Message(fix.Message, app_name='{{app_name}}'): | ||
def __init_subclass__(cls, **kwargs): | ||
cls.log.debug("{{app_name}} Message subclassed") | ||
for field in fix.Message.MandatoryFields: | ||
if field not in kwargs: | ||
raise ValueError(f"{field} missing when subclassing Message[{{app_name}}]") | ||
kwargs['app_name'] = '{{app_name}}' | ||
super().__init_subclass__(**kwargs) | ||
|
||
|
||
class ClientSession(fix.{{client_session}}): | ||
@classmethod | ||
def decode(cls, data: bytes) -> fix.Message: | ||
return Message.from_bytes(data) | ||
|
||
|
||
async def connect_async(remote: tuple[str, int], | ||
login_msg: Message, | ||
on_msg_coro = None, | ||
on_close_coro = None, | ||
client_heartbeat_interval: int = 10, | ||
server_heartbeat_interval: int = 10) -> fix.FixSession: | ||
session = ClientSession( | ||
on_msg_coro=on_msg_coro, | ||
on_close_coro=on_close_coro, | ||
client_heartbeat_interval=client_heartbeat_interval, | ||
server_heartbeat_interval=server_heartbeat_interval | ||
) | ||
return await fix.connect_async(remote, login_msg, lambda: session) |
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,3 +1,5 @@ | ||
from nasdaq_protocols import fix | ||
{{#modules}} | ||
from .{{name}} import * | ||
{{/modules}} | ||
|
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
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
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